source: trunk/dports/net/argus-monitor/Portfile @ 125354

Last change on this file since 125354 was 125354, checked in by khindenburg@…, 5 years ago

argus-monitor: add livecheck #39706

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.3 KB
Line 
1# $Id: Portfile 125354 2014-09-14 17:28:22Z khindenburg@macports.org $
2PortSystem      1.0
3
4name                    argus-monitor
5version                 3.5
6revision                3
7categories              net
8maintainers             markd
9description             The All Seeing System and Network Monitoring Software
10long_description        ${description}
11homepage                http://argus.tcp4me.com/
12platforms               darwin
13master_sites            http://www.tcp4me.com/code/argus-archive/
14checksums               md5 7a946b17a61edeb1b455f2ab45acf77d
15distfiles               argus-${version}.tgz
16worksrcdir              argus-${version}
17
18depends_lib             port:perl5.12 \
19                        port:postfix \
20                        port:openssl \
21                        port:freetype \
22                        port:gd2 \
23                        port:fping \
24                        port:db44 \
25                        port:p5.12-dbi \
26                        port:p5.12-berkeleydb \
27                        port:p5.12-socket6 \
28                        port:p5.12-gd \
29                        port:p5.12-time-hires \
30                        port:p5.12-net-ssleay \
31                        port:p5.12-digest-hmac \
32                        port:p5.12-digest-md5 \
33                        port:p5.12-digest-sha1 \
34                        port:p5.12-crypt-des
35
36patchfiles              patch-Makefile.tplt
37
38variant apple_postfix {
39        depends_lib-delete      port:postfix
40}
41
42startupitem.create      yes
43startupitem.name        argusd 
44startupitem.executable  "${prefix}/sbin/argusd"
45
46# Set the --data_dir configure argument and give me a pointer to it for later reference.
47set argus_data_dir ${prefix}/var/argus-monitor
48
49# Set the Argus htdocs directory.
50set argus_htdocs ${prefix}/share/${name}/htdocs
51
52configure.cmd           ./Configure
53configure.args          --bin_dir=${prefix}/bin \
54                        --sbin_dir=${prefix}/sbin \
55                        --lib_dir=${prefix}/lib/argus-monitor \
56                        --data_dir=${argus_data_dir} \
57                        --cgi_dir=${argus_htdocs}/cgi-bin
58
59post-patch {
60if { [variant_isset apple_postfix] } {
61        reinplace "s|/lib/sendmail|/usr/sbin/sendmail|g" \
62                ${worksrcpath}/examples/config
63} else {
64        reinplace "s|/lib/sendmail|${prefix}/sbin/sendmail|g" \
65                ${worksrcpath}/examples/config
66}
67}
68
69post-destroot {
70        xinstall -m 755 -d ${destroot}${argus_htdocs}/sound
71        xinstall -m 755 -d ${destroot}${argus_htdocs}/img
72        xinstall -m 755 ${worksrcpath}/misc/whoopwhoop.wav ${destroot}${argus_htdocs}/sound     
73        eval xinstall -m 640 [glob ${worksrcpath}/misc/*.gif] ${destroot}${argus_htdocs}/img
74        xinstall -m 644 -W ${worksrcpath}/misc argus.css argus.js \
75                ${destroot}${argus_htdocs}
76
77        file copy ${worksrcpath}/examples ${destroot}${prefix}/share/${name}
78
79        system "chown -R www:www ${destroot}${argus_data_dir}"
80        system "chown -R www:www ${destroot}${argus_htdocs}"
81
82        destroot.keepdirs \
83                ${destroot}${argus_data_dir}/gdata \
84                ${destroot}${argus_data_dir}/perl \
85                ${destroot}${argus_data_dir}/stats \
86                ${destroot}${argus_data_dir}/html \
87                ${destroot}${argus_data_dir}/notify
88}
89
90post-install {
91ui_msg "\n  *** To complete the Argus install ***
92
931) Modify the httpd.conf for Argus
94----------------------------------------------
95-Uncomment the line:
96        AddHandler cgi-script .cgi
97
98-Add a directive for the Argus data directory           
99 
100        ScriptAlias /argus \"${argus_htdocs}/cgi-bin/arguscgi\"
101        <Directory \"${argus_htdocs}/cgi-bin\">
102            Allow from all
103            Options ExecCGI
104        </Directory>
105
106
1072) Setup postfix so Argus can send mail via the command-line
108----------------------------------------------
109        cd ${prefix}/etc/postfix
110        sudo cp master.cf.sample master.cf
111        sudo cp main.cf.sample main.cf
112        sudo cp aliases.sample aliases
113
114Redirect OS X's sendmail executable to the one from MacPorts.
115        sudo mv /usr/sbin/sendmail /usr/sbin/sendmail.old
116        sudo ln -s ${prefix}/sbin/sendmail /usr/sbin/sendmail
117
118Startup postfix and set it to run at sytem boot.
119        sudo launchctl load -w /Library/LaunchDaemons/org.macports.postfix.plist
120
121Test postfix by sending a test email from a terminal window.
122        mail joe@mycompany.com
123
124NOTE: Make sure the SMTP server of the receiving domain will relay
125      mail from your Argus workstation.
126
127
1282) Setup the Argus config files
129----------------------------------------------
130-Remove the suffix \".example\" from the files config and user in
131 ${argus_data_dir} and customize them.  Also see ${prefix}/share/${name}/examples.
132
133
1343) Make the Argus files owned by the Apache user/group (default is \"www\")
135----------------------------------------------
136-Execute this terminal command:
137        sudo chown -R <apache-user>:<apache-group> ${prefix}/share/${name}/
138        sudo chown -R <apache-user>:<apache-group> ${argus_data_dir}/
139
140
1414) Rename config.example and user.example to config and user and customize them.
142----------------------------------------------
143For full config file information, see the developer documentation at
144http://argus.tcp4me.com/docs.html. But in a nutshell, it goes like this ....
145
146-The Argus config file is hierarchical; parameters that can be specified at
147 an upper level are inherited by objects below when not explicitly specified.
148
149So you may use service groups:
150
151        Group \"WebServers\" {
152                frequency:      5min
153                retries:        5
154                retrydelay:     10min
155                notify: mail:netadmins@mycompany.com
156
157                Host \"webserver.mycompany.com\" {
158                        Service TCP/HTTP
159                        Service TCP/HTTPS
160                        Service Ping
161                }
162
163                Host \"webmail.mycompany.com\" {
164                        Service TCP/HTTP
165                        Service TCP/HTTPS
166                        Service TCP/POP
167                        Service TCP/POPS
168                        Service TCP/IMAP
169                        Service TCP/IMAPS
170                        Service TCP/SMTP
171                        Service TCP/SMTPS
172                        Service Ping
173                        Service UDP {
174                                port:   501
175                        }
176
177                }
178
179                Host \"dns1.mycompany.com\" {
180                        Service UDP/DNS
181
182                }
183        }
184
185-Or you may use the \"shorthand\" notation and fully specify the characteristics
186 of individual hosts completely.
187
188        Host \"www.example.com\" {
189                Service TCP/HTTP
190                Service TCP/HTTPS
191                Service Ping
192                Service TCP {
193                        port: 12345
194                        info: YoyoDyne Application Server
195                }
196        }
197
198NOTE: Unlike C or Perl, you cannot place the opening \{ on a different line,
199      and the closing \} must be on a line by itself (with optional whitespace).
200
201-Rename config.example to config and customize it with your login passwords.
202
203
2045) Start argusd.
205----------------------------------------------
206
207-Start argusd in the foreground to test it:
208        sudo argusd -fd  (foreground & debug)
209
210-When you have argusd starting without errors, shutdown the foreground
211 processs using argusctl (or Control-C) and use launchctl to start argusd
212 in the background and set it to run at boot:
213
214        argusctl shutdown
215        sudo launchctl load -w /Library/LaunchDaemons/org.macports.argusd.plist
216
217-NOTE: Config file changes are detected automatically by Argus within a few minutes,
218        but the impatient may use argusctl:
219
220        argusctl hup
221
222
2235) Login to the Argus web interface to monitor your services.
224----------------------------------------------
225Login at http://localhost/argus
226
227\n"
228}
229
230livecheck.url       [lindex ${master_sites} 0]
231livecheck.regex     argus-(\[0-9.\]+).tgz
Note: See TracBrowser for help on using the repository browser.