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

Last change on this file was 151918, checked in by mojca@…, 13 months ago

argus-monitor: switch to perl5.24 (#52081)

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