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$ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | |
---|
6 | name xymon |
---|
7 | version 4.3.0-beta2 |
---|
8 | revision 1 |
---|
9 | categories net |
---|
10 | platforms darwin |
---|
11 | maintainers free.fr:fclaire |
---|
12 | |
---|
13 | description Xymon network monitor |
---|
14 | |
---|
15 | long_description Xymon is a system for monitoring of hosts and networks, \ |
---|
16 | inspired by the Big Brother system. It provides real-time \ |
---|
17 | monitoring, an easy web-interface, historical data, \ |
---|
18 | availability reports and performance graphs. \ |
---|
19 | Xymon was previously known as \"Hobbit\". |
---|
20 | |
---|
21 | homepage http://www.xymon.com/ |
---|
22 | master_sites sourceforge:xymon |
---|
23 | |
---|
24 | checksums md5 e3485d2b2b3680e45a941d911029a1a8 \ |
---|
25 | sha1 484ab668358856c7bbc7ba85bfe2afa7c0fa2f10 \ |
---|
26 | rmd160 ab8db88d1e2cb7363c8a9b35396094ea921cc5b5 |
---|
27 | |
---|
28 | depends_lib port:rrdtool \ |
---|
29 | port:fping \ |
---|
30 | port:pcre \ |
---|
31 | port:libpng \ |
---|
32 | port:openssl \ |
---|
33 | port:openldap |
---|
34 | |
---|
35 | patchfiles patch-build-Makefile.rules.diff \ |
---|
36 | patch-lib-Makefile.diff \ |
---|
37 | patch-client-hobbitclient-darwin.sh.diff |
---|
38 | |
---|
39 | if {"darwin" == ${os.platform} && ${os.major} > 8} { |
---|
40 | set xymonuser _xymon |
---|
41 | } else { |
---|
42 | set xymonuser xymon |
---|
43 | } |
---|
44 | set xymongroup ${xymonuser} |
---|
45 | set xytopdir ${prefix}/lib/${name} |
---|
46 | set xylogdir ${prefix}/var/log/${name} |
---|
47 | set xytmpdir ${xytopdir}/tmp |
---|
48 | set bbvardir ${xytopdir}/data |
---|
49 | set xywebdir ${xytopdir}/web |
---|
50 | set xywwwdir ${xytopdir}/www |
---|
51 | |
---|
52 | addgroup ${xymongroup} |
---|
53 | adduser ${xymonuser} gid=[existsgroup ${xymongroup}] realname=Xymon\ User home=${xytopdir} shell=/bin/bash |
---|
54 | |
---|
55 | file mkdir ${destroot}${xytopdir} |
---|
56 | file mkdir ${destroot}${xylogdir} |
---|
57 | file mkdir ${destroot}${xytmpdir} |
---|
58 | |
---|
59 | default_variants +client |
---|
60 | |
---|
61 | variant server description {Xymon server} { |
---|
62 | configure.cmd ./configure.server |
---|
63 | configure.args-append --rrdinclude ${prefix}/include \ |
---|
64 | --rrdlib ${prefix}/lib \ |
---|
65 | --pcreinclude ${prefix}/include \ |
---|
66 | --pcrelib ${prefix}/lib \ |
---|
67 | --sslinclude ${prefix}/include \ |
---|
68 | --ssllib ${prefix}/lib \ |
---|
69 | --ldapinclude ${prefix}/include \ |
---|
70 | --ldaplib ${prefix}/lib \ |
---|
71 | --fping ${prefix}/sbin/fping |
---|
72 | configure.env-append ENABLESSL=y \ |
---|
73 | ENABLELDAP=y \ |
---|
74 | ENABLELDAPSSL=y \ |
---|
75 | BBUSER=${xymonuser} \ |
---|
76 | USEHOBBITPING=n \ |
---|
77 | BBTOPDIR=${xytopdir} \ |
---|
78 | BBHOSTURL=/${name} \ |
---|
79 | CGIDIR=${xytopdir}/cgi-bin \ |
---|
80 | BBCGIURL=/${name}-cgi \ |
---|
81 | SECURECGIDIR=${xytopdir}/cgi-secure \ |
---|
82 | SECUREBBCGIURL=/${name}-secgci \ |
---|
83 | HTTPDGID=_www \ |
---|
84 | BBLOGDIR=${xylogdir} \ |
---|
85 | BBHOSTNAME=localhost \ |
---|
86 | BBHOSTIP=127.0.0.1 \ |
---|
87 | BBHOSTOS=${os.platform} \ |
---|
88 | MANROOT=${prefix}/share/man \ |
---|
89 | INSTALLBINDIR=${xytopdir}/server/bin \ |
---|
90 | INSTALLETCDIR=${xytopdir}/etc \ |
---|
91 | INSTALLEXTDIR=${xytopdir}/server/ext \ |
---|
92 | INSTALLTMPDIR=${xytmpdir} \ |
---|
93 | INSTALLWEBDIR=${xywebdir} \ |
---|
94 | INSTALLWWWDIR=${xywwwdir} \ |
---|
95 | BBVAR=${bbvardir} |
---|
96 | |
---|
97 | destroot.env-append INSTALLROOT=${destroot} |
---|
98 | destroot.keepdirs ${destroot}${xytopdir} \ |
---|
99 | ${destroot}${xylogdir} \ |
---|
100 | ${destroot}${xytmpdir} \ |
---|
101 | ${destroot}${bbvardir}/acks \ |
---|
102 | ${destroot}${bbvardir}/data \ |
---|
103 | ${destroot}${bbvardir}/disabled \ |
---|
104 | ${destroot}${bbvardir}/hist \ |
---|
105 | ${destroot}${bbvardir}/histlogs \ |
---|
106 | ${destroot}${bbvardir}/hostdata \ |
---|
107 | ${destroot}${bbvardir}/logs \ |
---|
108 | ${destroot}${bbvardir}/rrd \ |
---|
109 | ${destroot}${bbvardir} \ |
---|
110 | ${destroot}${xywebdir} \ |
---|
111 | ${destroot}${xywwwdir}/html \ |
---|
112 | ${destroot}${xywwwdir}/rep \ |
---|
113 | ${destroot}${xywwwdir}/snap \ |
---|
114 | ${destroot}${xywwwdir}/notes \ |
---|
115 | ${destroot}${xywwwdir}/wml |
---|
116 | |
---|
117 | post-destroot { |
---|
118 | # Adding own startupitem - xymon needs to be run under _xymon user |
---|
119 | xinstall -d ${destroot}${prefix}/etc/LaunchDaemons/org.macports.${name}/ |
---|
120 | xinstall -m 644 ${filespath}/org.macports.${name}.server.plist ${destroot}${prefix}/etc/LaunchDaemons/org.macports.${name}/ |
---|
121 | xinstall -m 644 ${filespath}/INSTALL.macports.xymon.server ${destroot}${xytopdir} |
---|
122 | } |
---|
123 | |
---|
124 | post-activate { |
---|
125 | # Creation of a symbolic link towards startupitem |
---|
126 | #file link -symbolic ${prefix}/etc/LaunchDaemons/org.macports.${name}/org.macports.${name}.plist /Library/LaunchDaemons/org.macports.${name}.plist |
---|
127 | #file link -symbolic ${xytopdir}/tmp ${xytopdir}/client/tmp |
---|
128 | system "/bin/ln -sf ${prefix}/etc/LaunchDaemons/org.macports.${name}/org.macports.${name}.plist /Library/LaunchDaemons/org.macports.${name}.server.plist" |
---|
129 | system "/bin/ln -sf ${xytmpdir} ${xytopdir}/client/tmp" |
---|
130 | |
---|
131 | # Couldn't find how to display the content of a file with a cat command |
---|
132 | # So I include it inside this Portfile |
---|
133 | # Reminder: awk '/^### INSTALL Server ###$/ {print; while ((getline < "files/INSTALL.macports.xymon.server") > 0) print; next} {print}' Portfile.work > Portfile |
---|
134 | ### INSTALL Server ### |
---|
135 | ui_msg " *** To complete the Xymon install *** |
---|
136 | |
---|
137 | |
---|
138 | 1) Tune the number of shared message queues |
---|
139 | ---------------------------------------------- |
---|
140 | |
---|
141 | Xymon server needs at least 9 IPC message queues to run. |
---|
142 | Unfortunately Mac OS X ships with a default max of 8. |
---|
143 | |
---|
144 | Check how much shared segments a process can use on |
---|
145 | your system: |
---|
146 | $ sysctl kern.sysv.shmseg |
---|
147 | And the max number of shared segments system-wide: |
---|
148 | $ sysctl kern.sysv.shmmni |
---|
149 | |
---|
150 | If the first number is < 9, you need to tune your system |
---|
151 | before trying to start xymon server (doing so will make |
---|
152 | the whole system to crash). |
---|
153 | |
---|
154 | Run the following commands to increase your shared |
---|
155 | segments: |
---|
156 | $ sudo echo \"kern.sysv.shmmni=64\" >> /etc/sysctl.conf |
---|
157 | $ sudo echo \"kern.sysv.shmseg=12\" >> /etc/sysctl.conf |
---|
158 | |
---|
159 | Reboot your system to activate the change. After reboot you can |
---|
160 | read these instructions with: |
---|
161 | $ cat /opt/local/lib/xymon/INSTALL.macports.xymon.server |
---|
162 | |
---|
163 | More information about shared memory segments on Mac OS X |
---|
164 | can be found here: http://support.apple.com/kb/HT4022 |
---|
165 | |
---|
166 | |
---|
167 | |
---|
168 | 2) Configure your apache web server |
---|
169 | ---------------------------------------------- |
---|
170 | |
---|
171 | Xymon \"make install\" ends with: |
---|
172 | You must configure your webserver for the Hobbit webpages and CGI-scripts. |
---|
173 | A sample Apache configuration is in /opt/local/lib/xymon/server/etc/hobbit-apache.conf |
---|
174 | If you have your Administration CGI scripts in a separate directory, |
---|
175 | then you must also setup the password-file with the htpasswd command. |
---|
176 | |
---|
177 | So the following commands should do it: |
---|
178 | $ sudo mv /opt/local/lib/xymon/server/etc/hobbit-apache.conf /etc/apache2/sites/ |
---|
179 | $ sudo /usr/sbin/apachectl restart |
---|
180 | |
---|
181 | |
---|
182 | |
---|
183 | 3) Make user _xymon part of the admin group: |
---|
184 | ---------------------------------------------- |
---|
185 | |
---|
186 | We achieve this with the Directory Service command line utility: |
---|
187 | $ sudo dscl . -append /Groups/admin GroupMembership _xymon |
---|
188 | |
---|
189 | |
---|
190 | |
---|
191 | |
---|
192 | 4) Start Xymon server |
---|
193 | ---------------------------------------------- |
---|
194 | |
---|
195 | A startup item has been generated that will aid in |
---|
196 | starting xymon with launchd. It is disabled |
---|
197 | by default. Execute the following command to start it, |
---|
198 | and to cause it to launch at startup: |
---|
199 | |
---|
200 | $ sudo launchctl load -w /Library/LaunchDaemons/org.macports.xymon.plist |
---|
201 | |
---|
202 | If your Mac OSX firewall is enabled, you'll be asked to allow |
---|
203 | xymon -> accept |
---|
204 | On Mac OSX Server, make sure your ipfw rules will allow |
---|
205 | incoming TCP conections to port 1984 |
---|
206 | |
---|
207 | |
---|
208 | 5) check the status of your Xymon server |
---|
209 | ---------------------------------------------- |
---|
210 | |
---|
211 | To view the Xymon webpages, go to http://localhost/xymon |
---|
212 | |
---|
213 | ---------------------------------------------- |
---|
214 | |
---|
215 | |
---|
216 | |
---|
217 | |
---|
218 | *** Quick start for the impatient *** |
---|
219 | |
---|
220 | Run the following commands in your terminal: |
---|
221 | $ sudo echo \"kern.sysv.shmmni=64\" >> /etc/sysctl.conf |
---|
222 | $ sudo echo \"kern.sysv.shmseg=12\" >> /etc/sysctl.conf |
---|
223 | $ sudo mv /opt/local/lib/xymon/server/etc/hobbit-apache.conf /etc/apache2/sites/ |
---|
224 | $ sudo /usr/sbin/apachectl restart |
---|
225 | $ sudo dscl . -append /Groups/admin GroupMembership _xymon |
---|
226 | Reboot your system |
---|
227 | $ sudo launchctl load -w /Library/LaunchDaemons/org.macports.xymon.plist |
---|
228 | Open http://localhost/xymon in your server's browser |
---|
229 | |
---|
230 | " |
---|
231 | } |
---|
232 | } |
---|
233 | |
---|
234 | variant client description {Xymon client} { |
---|
235 | configure.cmd ./configure.client |
---|
236 | configure.args-append --rrdinclude ${prefix}/include \ |
---|
237 | --rrdlib ${prefix}/lib \ |
---|
238 | --pcreinclude ${prefix}/include \ |
---|
239 | --pcrelib ${prefix}/lib \ |
---|
240 | --sslinclude ${prefix}/include \ |
---|
241 | --ssllib ${prefix}/lib \ |
---|
242 | --ldapinclude ${prefix}/include \ |
---|
243 | --ldaplib ${prefix}/lib \ |
---|
244 | --fping ${prefix}/sbin/fping |
---|
245 | configure.env-append ENABLESSL=y \ |
---|
246 | BBUSER=${xymonuser} \ |
---|
247 | BBTOPDIR=${xytopdir} \ |
---|
248 | BBHOSTIP=127.0.0.1 \ |
---|
249 | BBHOSTOS=${os.platform} \ |
---|
250 | MANROOT=${prefix}/share/man \ |
---|
251 | INSTALLBINDIR=${xytopdir}/client/bin \ |
---|
252 | INSTALLETCDIR=${xytopdir}/etc \ |
---|
253 | INSTALLEXTDIR=${xytopdir}/client/ext \ |
---|
254 | INSTALLTMPDIR=${xytmpdir} \ |
---|
255 | INSTALLWEBDIR=${xywebdir} \ |
---|
256 | INSTALLWWWDIR=${xywwwdir} \ |
---|
257 | BBVAR=${bbvardir} |
---|
258 | |
---|
259 | destroot.env-append INSTALLROOT=${destroot} |
---|
260 | destroot.keepdirs ${destroot}${xytopdir} \ |
---|
261 | ${destroot}${xylogdir} \ |
---|
262 | ${destroot}${xytmpdir} \ |
---|
263 | ${destroot}${bbvardir}/logs \ |
---|
264 | ${destroot}${bbvardir} \ |
---|
265 | ${destroot}${xywebdir} |
---|
266 | |
---|
267 | startupitem.create yes |
---|
268 | startupitem.start "sudo su ${xymonuser} -c \"${xytopdir}/client/runclient.sh start\"" |
---|
269 | startupitem.stop "sudo su ${xymonuser} -c \"${xytopdir}/client/runclient.sh stop\"" |
---|
270 | startupitem.restart "sudo su ${xymonuser} -c \"${xytopdir}/client/runclient.sh restart\"" |
---|
271 | #startupitem.pidfile auto ${xylogdir}/clientlaunch.*.pid |
---|
272 | startupitem.pidfile none |
---|
273 | |
---|
274 | post-destroot { |
---|
275 | xinstall -d -o ${xymonuser} -g ${xymongroup} ${destroot}${xylogdir} |
---|
276 | xinstall -d -o ${xymonuser} -g ${xymongroup} ${destroot}${xytmpdir} |
---|
277 | } |
---|
278 | |
---|
279 | post-activate { |
---|
280 | system "/bin/ln -sf ${xytmpdir} ${xytopdir}/client/tmp" |
---|
281 | system "/bin/ln -sf ${xylogdir} ${xytopdir}/client/logs" |
---|
282 | |
---|
283 | ui_msg "\nSet your Xymon server's IP address with the following command: |
---|
284 | $ sudo vi ${xytopdir}/client/etc/hobbitclient.cfg |
---|
285 | |
---|
286 | If you wish to have your xymon client report logfiles to your xymon server |
---|
287 | you need to add the user _xymon to the admin group like this: |
---|
288 | $ sudo dscl . -append /Groups/admin GroupMembership _xymon |
---|
289 | " |
---|
290 | } |
---|
291 | } |
---|
292 | |
---|
293 | use_parallel_build no |
---|
294 | |
---|