source: trunk/dports/net/smokeping/Portfile @ 125738

Last change on this file since 125738 was 125738, checked in by mf2k@…, 4 years ago

adodb argus-monitor base blt cacti cdpr doclifter eventlog expect gkrellm honeyd iwidgets kchmviewer libdnsres monarch moodss moomps nagios nagios-plugins nedi netmrg network-weathermap nfdump nfsen nrg nrpe nsca ntop p5-archive-zip p5-cgi p5-cgi-speedycgi p5-convert-asn1 p5-libintl-perl p5-mhonarc p5-net p5-perl-ldap rancid rrdtool scotty sendpage smokeping snort sympa syslog-ng tclx tftp-hpa tktable uplog vm-pop3d xserve-raid-tools zabbix: Ports abandoned by markd. (#44782)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.8 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 125738 2014-09-25 14:43:03Z mf2k@macports.org $
3
4PortSystem          1.0
5
6PortGroup           perl5 1.0
7
8name                smokeping
9version             2.6.8
10revision            1
11categories          net perl
12maintainers         nomaintainer
13description         A deluxe latency logging and graphing system.
14long_description    SmokePing is a deluxe latency measurement tool. \
15                    It can measure, store, and display latency, latency \
16                    distribution, and packet loss. SmokePing uses RRDtool \
17                    to maintain a longterm data-store and to draw pretty \
18                    graphs, giving up to the minute information on the \
19                    state of each network connection.
20
21platforms           darwin
22homepage            http://oss.oetiker.ch/smokeping/
23master_sites        http://oss.oetiker.ch/smokeping/pub/
24
25checksums           rmd160  4a81dfbceee93f917d77698a9b73f6133eb21ffa \
26                    sha256  15fd99487d01649a552d2954bc1c6b0442967a72fca51c8ff197447389b1b16c
27
28patchfiles          patch-etc-config.dist.diff \
29                    patch-bin-smokeping.diff \
30                    patch-bin-tSmoke.diff \
31                    patch-bin-smokeinfo.diff \
32                    patch-bin-smokeping_cgi.diff
33
34set perl_version    5.16
35perl5.branches      ${perl_version}
36
37depends_lib-append  port:perl${perl_version} \
38                    port:p${perl_version}-fcgi \
39                    port:p${perl_version}-libwww-perl \
40                    port:p${perl_version}-socket6 \
41                    port:p${perl_version}-net-snmp \
42                    port:p${perl_version}-net-telnet \
43                    port:p${perl_version}-net-dns \
44                    port:p${perl_version}-net-radius \
45                    port:p${perl_version}-perl-ldap \
46                    port:p${perl_version}-io-socket-ssl \
47                    port:p${perl_version}-pathtools \
48                    port:p${perl_version}-snmp_session \
49                    port:p${perl_version}-config-grammar \
50                    port:mod_fastcgi \
51                    port:apache2 \
52                    port:rrdtool \
53                    port:fping \
54                    port:curl
55
56set smokeroot ${prefix}/lib/smokeping
57set smokedata ${prefix}/var/smokeping
58set smokeetc ${prefix}/etc
59set macports_apache_docroot ${prefix}/apache2/htdocs
60
61startupitem.create  yes
62startupitem.name    smokeping
63startupitem.executable \
64                    ${prefix}/bin/smokeping --nodaemon
65
66
67post-patch {
68    reinplace "s|__PREFIX__|${prefix}|g" \
69        ${worksrcpath}/bin/smokeping \
70        ${worksrcpath}/bin/tSmoke \
71        ${worksrcpath}/bin/smokeinfo \
72        ${worksrcpath}/bin/smokeping_cgi \
73        ${worksrcpath}/etc/config.dist
74
75    reinplace "s|__PERL5__ARCHLIB__|${perl5.archlib}|g" \
76        ${worksrcpath}/bin/smokeping \
77        ${worksrcpath}/bin/tSmoke \
78        ${worksrcpath}/bin/smokeinfo \
79        ${worksrcpath}/bin/smokeping_cgi
80
81    reinplace "s|/usr/bin/|${prefix}/bin/|g" \
82        ${worksrcpath}/lib/Smokeping.pm \
83        ${worksrcpath}/lib/Smokeping/Examples.pm \
84        ${worksrcpath}/lib/Smokeping/probes/Curl.pm \
85        ${worksrcpath}/lib/Smokeping/probes/RemoteFPing.pm \
86        ${worksrcpath}/lib/Smokeping/probes/SSH.pm \
87        ${worksrcpath}/lib/Smokeping/probes/FPing6.pm \
88        ${worksrcpath}/lib/Smokeping/probes/EchoPing.pm \
89        ${worksrcpath}/lib/Smokeping/probes/FPing.pm
90
91    reinplace "s|/usr/share/smokeping/etc|${smokeetc}|g" \
92        ${worksrcpath}/lib/Smokeping/probes/passwordchecker.pm
93}
94
95post-destroot {
96
97# Create and retain the data directory
98
99    xinstall -m 755 -d ${destroot}${smokedata}/log
100    destroot.keepdirs ${destroot}${smokedata}/log
101}
102
103notes \
104"  #### To complete the Smokeping installation ####
105
1061) Enable mod_fastcgi (installed as a dependency of Smokeping) for MacPorts Apache 2.
107
108   -Rdd the line below to ${prefix}/apache2/conf/httpd.conf.
109
110        LoadModule fastcgi_module modules/mod_fastcgi.so
111
112
1132)  Changes to httpd.conf for Smokeping.
114
115   -Uncomment this line to enable the CGI script handler.
116
117        AddHandler cgi-script .cgi
118
119   -Add a directive for Smokeping's data directory and add
120    smokeping.cgi to DirectoryIndex for a simple /smokeping url.
121
122        Alias /smokeping \"${prefix}/var/smokeping\"
123        <Directory \"${prefix}/var/smokeping\">
124            Allow from all
125            Options ExecCGI
126        </Directory>
127
128        <IfModule dir_module>
129            DirectoryIndex index.html smokeping.cgi
130        </IfModule>
131
132
1333) Set Smokeping data directory permissions to the Apache user and group set
134   in httpd.conf.  The default Apache user and group for OS X is www.
135
136        sudo chown -R <smokeping-user>:<smokeping-group> ${smokedata}/
137
138
1394) Setup Smokeping logging.
140
141   -Add this statement to /etc/syslog.conf.
142
143   local1.*     ${smokedata}/log/smokeping.log
144
145   -Create a logfile to receive the log messages.
146
147        cd ${smokedata}/log
148        sudo touch smokeping.log
149        sudo chmod 600 smokeping.log
150        sudo chown root:admin smokeping.log
151
152   -Then restart the syslog facility.
153
154        sudo kill -HUP `cat /var/run/syslog.pid`
155
156
1575) Rename and edit the ${smokeetc}/config sample files, then test your config file.
158
159   -Remove the .dist extension from all files; do not change the filenames.
160
161        cd ${smokeetc}
162        sudo mv config.dist config
163
164   -Set the DNS names for the Smokeping config file url's \"imageurl\" and \"cgiurl\".
165    But you should leave all file paths alone -they are set by MacPorts.
166
167        imgurl   = http://myhost.mycompany.com/smokeping
168        cgiurl   = http://myhost.mycompany.com/smokeping/smokeping.cgi
169
170   -Customize variables.
171
172     * General * - owner, contact, and mailhost
173     * Alerts  * - to, from addresses
174
175   -Then clear the examples \(they have a leading '+'\) in the *** Targets ***
176    section and set your own.
177
178        + My Web Server
179           menu = MyWebServer
180           title = My Web Server
181           host = mywebserver.mydomain.com
182           alerts = bigloss,someloss,startloss
183
184    -See sample configurations and examples in ${prefix}/share/doc/smokeping/.
185
186    -Perform a config file test from a terminal window and correct any errors that
187     are reported.
188
189        smokeping --check
190
191
1926) Start Smokeping and verify it is running.  (Give it a minute to start)
193
194        sudo launchctl load -w /Library/LaunchDaemons/org.macports.smokeping.plist
195        ps -ax |grep smoke
196
197 1713  Ss 0:00.16 ${prefix}/bin/smokeping \[FPing\]
198 1753  Ss 0:00.18 ${prefix}/bin/speedy_backend -w ${prefix}/apache2/htdocs/smokeping/smokeping.cgi
199 1754  S  0:01.56 ${prefix}/bin/speedy_backend -w ${prefix}/apache2/htdocs/smokeping/smokeping.cgi
200
201
2027) Check the Smokeping graphs with a web browser.
203
204   Go to http://localhost/smokeping
205
206
2078) Add or remove targets from Smokeping.
208
209   After adding or removing targets from ${smokeetc}/config, you must reload
210   Smokeping from a terminal window.
211
212        sudo smokeping --reload"
Note: See TracBrowser for help on using the repository browser.