1 %define debug_package %{nil}
3 %define _prefix /usr/local/zabbix
8 Group: System Environment/Daemons
10 Summary: ZABBIX network monitor server
12 URL: http://www.zabbix.org
13 Packager: Eugene Grigorjev <eugene.grigorjev@zabbix.com>
14 Source: zabbix-%{version}.tar.gz
17 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
22 %define zabbix_bindir %{_prefix}/bin
23 %define zabbix_datadir %{_prefix}/misc
24 %define zabbix_confdir %{_prefix}/conf
25 %define zabbix_initdir %{_prefix}/init.d
26 %define zabbix_docdir %{_prefix}/doc
27 %define zabbix_webdir /var/www/html/zabbix
28 #%define zabbix_piddir %{_tmppath}
29 #%define zabbix_logdir %{_tmppath}
31 %define zabbix_piddir /var/tmp
32 %define zabbix_logdir /var/tmp
35 The ZABBIX server is a network monitor
38 Summary: ZABBIX network monitor agent daemon
39 Group: System Environment/Daemons
41 The ZABBIX client is a network monitor
44 Summary: ZABBIX network monitor server daemon
45 Group: System Environment/Daemons
46 BuildPrereq: postgresql-devel
47 BuildPrereq: net-snmp-devel
48 #BuildPrereq: gnutls-devel
49 #BuildPrereq: libtasn1-devel
52 Requires: postgresql-server
56 The ZABBIX server is a network monitor
59 Summary: ZABBIX network monitor server frontend
60 Group: Productivity/Networking/Web/Frontends
63 Requires: postgresql-server
66 The ZABBIX gui frontend
69 %setup -n zabbix-%{version}
73 # TODO: there must be a better way. unfortunately, this package doesn't build
74 # after running ./configure from a subdir, i.e. mkdir client; cd client; ../configure... ; make-> fails.
81 ./configure --enable-static --enable-agent
86 ./configure --enable-server --with-pgsql --with-net-snmp --with-libcurl
91 rm -fr $RPM_BUILD_ROOT
94 rm -fr $RPM_BUILD_ROOT
96 ################# SERVER
99 install -d %{buildroot}%{zabbix_docdir}
100 install -m 644 server/AUTHORS %{buildroot}%{zabbix_docdir}/AUTHORS
101 install -m 644 server/COPYING %{buildroot}%{zabbix_docdir}/COPYING
102 install -m 644 server/NEWS %{buildroot}%{zabbix_docdir}/NEWS
103 install -m 644 server/README %{buildroot}%{zabbix_docdir}/README
106 install -d %{buildroot}%{zabbix_bindir}
107 install -s -m 755 server/src/zabbix_server/zabbix_server %{buildroot}%{zabbix_bindir}/zabbix_server
110 install -d %{buildroot}%{zabbix_confdir}
111 install -m 755 server/misc/conf/zabbix_server.conf %{buildroot}%{zabbix_confdir}/zabbix_server.conf
112 install -d %{buildroot}/etc/zabbix
113 install -m 755 server/misc/conf/zabbix_server.conf %{buildroot}/etc/zabbix
115 # copy startup script
116 install -d %{buildroot}%{zabbix_initdir}
117 install -m 755 server/misc/init.d/fedora/core/zabbix_server %{buildroot}%{zabbix_initdir}/zabbix_server
119 install -d %{buildroot}%{zabbix_datadir}
120 cp -r server/create %{buildroot}%{zabbix_datadir}
122 ################# CLIENT
124 install -d %{buildroot}%{zabbix_bindir}
125 install -s -m 755 client/src/zabbix_agent/zabbix_agentd %{buildroot}%{zabbix_bindir}/zabbix_agentd
128 install -d %{buildroot}%{zabbix_confdir}
129 install -m 755 client/misc/conf/zabbix_agentd.conf %{buildroot}%{zabbix_confdir}/zabbix_agentd.conf
130 install -d %{buildroot}/etc/zabbix
131 install -m 755 client/misc/conf/zabbix_agentd.conf %{buildroot}/etc/zabbix
133 # copy startup script
134 install -d %{buildroot}%{zabbix_initdir}
135 install -m 755 client/misc/init.d/fedora/core/zabbix_agentd %{buildroot}%{zabbix_initdir}/zabbix_agentd
137 ################# GUI
139 install -d %{buildroot}%{zabbix_webdir}
140 cp -r frontends/php/* %{buildroot}%{zabbix_webdir}
143 # create ZABBIX group
144 if [ -z "`grep zabbix /etc/group`" ]; then
145 /usr/sbin/groupadd zabbix >/dev/null 2>&1
149 if [ -z "`grep zabbix /etc/passwd`" ]; then
150 /usr/sbin/useradd -g zabbix zabbix >/dev/null 2>&1
153 # configure ZABBIX agentd daemon
154 TMP_FILE=`mktemp $TMPDIR/zbxtmpXXXXXX`
156 # TODO: setup Server=, Hostname=,
157 SERVER=`grep PLC_MONITOR_HOST /etc/planetlab/plc_config | tr "'" ' ' | awk '{print $2}'`
158 if [ -z "$SERVER" ] ; then
159 SERVER=128.112.139.116
162 sed -e "s#Hostname=.*#Hostname=$HOST#g" \
163 -e "s#Server=.*#Server=$SERVER#g" \
164 -e "s#PidFile=/var/tmp/zabbix_agentd.pid#PidFile=%{zabbix_piddir}/zabbix_agentd.pid#g" \
165 -e "s#LogFile=/tmp/zabbix_agentd.log#LogFile=%{zabbix_logdir}/zabbix_agentd.log#g" \
166 %{zabbix_confdir}/zabbix_agentd.conf > $TMP_FILE
167 cat $TMP_FILE > %{zabbix_confdir}/zabbix_agentd.conf
169 cp %{zabbix_confdir}/zabbix_agentd.conf /etc/zabbix/
170 # TODO: copy to /etc/zabbix/
172 sed -e "s#BASEDIR=/opt/zabbix#BASEDIR=%{_prefix}#g" \
173 -e "s#PIDFILE=/var/tmp/zabbix_agentd.pid#PIDFILE=%{zabbix_piddir}/zabbix_agentd.pid#g" \
174 %{zabbix_initdir}/zabbix_agentd > $TMP_FILE
175 cat $TMP_FILE > %{zabbix_initdir}/zabbix_agentd
177 # NOTE: Run every runlevel as soon as possible, and stop as late as possible
178 cp %{zabbix_initdir}/zabbix_agentd %{_initrddir}
179 sed -i -e "s#chkconfig: - 90 10#chkconfig: 2345 12 90#g" \
180 %{_initrddir}/zabbix_agentd
184 chkconfig --add zabbix_agentd
185 chkconfig zabbix_agentd on
186 service zabbix_agentd start
190 # create ZABBIX group
191 if [ -z "`grep zabbix /etc/group`" ]; then
192 /usr/sbin/groupadd zabbix >/dev/null 2>&1
196 if [ -z "`grep zabbix /etc/passwd`" ]; then
197 /usr/sbin/useradd -g zabbix zabbix >/dev/null 2>&1
200 # configure ZABBIX server daemon
201 TMP_FILE=`mktemp $TMPDIR/zbxtmpXXXXXX`
203 sed -e "s#AlertScriptsPath=/home/zabbix/bin/#AlertScriptsPath=%{zabbix_bindir}/#g" \
204 -e "s#PidFile=/var/tmp/zabbix_server.pid#PidFile=%{zabbix_piddir}/zabbix_server.pid#g" \
205 -e "s#LogFile=/tmp/zabbix_server.log#LogFile=%{zabbix_logdir}/zabbix_server.log#g" \
206 -e "s|#DBPassword|DBPassword|g" \
207 %{zabbix_confdir}/zabbix_server.conf > $TMP_FILE
208 cat $TMP_FILE > %{zabbix_confdir}/zabbix_server.conf
209 mkdir -p %{_sysconfdir}/zabbix
210 cp %{zabbix_confdir}/zabbix_server.conf %{_sysconfdir}/zabbix/
212 sed -e "s#BASEDIR=/opt/zabbix#BASEDIR=%{_prefix}#g" \
213 -e "s#PIDFILE=/var/tmp/zabbix_server.pid#PIDFILE=%{zabbix_piddir}/zabbix_server.pid#g" \
214 %{zabbix_initdir}/zabbix_server > $TMP_FILE
215 cat $TMP_FILE > %{zabbix_initdir}/zabbix_server
218 # NOTE: Run every runlevel as soon as possible, and stop as late as possible
219 cp %{zabbix_initdir}/zabbix_server %{_initrddir}
220 sed -i -e "s#chkconfig: - 90 10#chkconfig: 2345 12 90#g" \
221 %{_initrddir}/zabbix_server
223 chkconfig --add zabbix_server
224 chkconfig zabbix_server on
227 # Setup the necessary values in /etc/php.ini
228 # NOTE: Zabbix requires max_execution_time to be 300 seconds
229 # NOTE: Zabbix requires a default date.timezone
231 # also edit /var/www/html/zabbix/conf/zabbix.conf.php
232 # touch /var/www/html/zabbix/conf/zabbix.conf.php
233 # chmod 644 /var/www/html/zabbix/conf/zabbix.conf.php
236 TMP_FILE=`mktemp $TMPDIR/zbxtmpXXXXXX`
237 sed -e "s#;date.timezone =#date.timezone = UTC#g" \
238 -e "s#max_execution_time = 30 #max_execution_time = 300 #g" \
239 %{_sysconfdir}/php.ini > $TMP_FILE
240 cat $TMP_FILE > %{_sysconfdir}/php.ini
244 rm -f %{zabbix_piddir}/zabbix_server.pid
245 rm -f %{zabbix_logdir}/zabbix_server.log
247 rm -f %{zabbix_piddir}/zabbix_agentd.pid
248 rm -f %{zabbix_logdir}/zabbix_agentd.log
251 %defattr(-,root,root)
253 %dir %attr(0755,root,root) %{zabbix_confdir}
254 %attr(0644,root,root) %config(noreplace) %{zabbix_confdir}/zabbix_agentd.conf
256 %dir %attr(0755,root,root) %{zabbix_bindir}
257 %attr(0755,root,root) %{zabbix_bindir}/zabbix_agentd
259 %dir %attr(0755,root,root) %{zabbix_initdir}
260 %attr(0755,root,root) %{zabbix_initdir}/zabbix_agentd
262 %config /etc/zabbix/zabbix_agentd.conf
265 %defattr(-,root,root)
267 %dir %attr(0755,root,root) %{zabbix_docdir}
268 %attr(0644,root,root) %{zabbix_docdir}/AUTHORS
269 %attr(0644,root,root) %{zabbix_docdir}/COPYING
270 %attr(0644,root,root) %{zabbix_docdir}/NEWS
271 %attr(0644,root,root) %{zabbix_docdir}/README
273 %dir %attr(0755,root,root) %{zabbix_confdir}
274 %attr(0644,root,root) %config(noreplace) %{zabbix_confdir}/zabbix_server.conf
276 %dir %attr(0755,root,root) %{zabbix_bindir}
277 %attr(0755,root,root) %{zabbix_bindir}/zabbix_server
279 %dir %attr(0755,root,root) %{zabbix_initdir}
280 %attr(0755,root,root) %{zabbix_initdir}/zabbix_server
282 %dir %attr(0755,root,root) %{zabbix_datadir}
283 %attr(0755,root,root) %{zabbix_datadir}/create/
285 %config /etc/zabbix/zabbix_server.conf
288 %defattr(-,root,root)
289 %dir %{zabbix_webdir}
293 * Fri Nov 20 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-25
294 - add option for site status to include both node & pcu status
295 - improve ticket handling
296 - template gadget.xml for a site-specific google-gadget summary
298 * Thu Oct 22 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-24
301 * Mon Oct 19 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-23
302 - - remove monitor-client.cron
303 - - remove unused monitor-client init script
304 - - fix UP/DOWN summary on nodes page.
305 - - make node page display all nodes by default
306 - - add boot_server field
307 - - add myops_ssh_key to the keychain
308 - - use ext_consortium_id to distinguish pending sites.
310 * Fri Oct 09 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-22
311 - show/hide advance query form.
313 * Thu Sep 24 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-21
314 - fixed pause_penalty bug.
315 - fixed IPAL pcucontrol bug
316 - fixed bootman tunnel setup bug (occurred in rare cases)
318 - added BootmanSequenceRecords to separate config data from source code
319 - added get/setBootmanSequence(s) to xmlrpc API
321 * Fri Sep 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-20
323 - added bm log collection and optional integration with BootManager's log Upload()
324 - added iptables_status
325 - expanded advanced query
326 - added differentiated bootmanager_restore actions so that actionsummary displays
327 - counts for each kind of bootmanager action
328 - added pcuerror notices (for mis-configurations) in addition to pcufailed notices
329 - added plain-text options for query page by adding tg_format=plain to URL
330 - fixed cross-module reference that prevented pcucontrol for working with RebootNodeWithPCU() api call.
331 - fixed a bug in determining whether comon's dir was running on a node
333 * Mon Aug 17 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-19
335 - adds multiple features and web changes
336 - adds new fields to db
338 - general improvements otherwise
340 * Sun Jun 28 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-18
342 - improved templates and views
343 - cleaned controller code for web
344 - added IPMI requirement to pcucontrol package.
346 * Thu Jun 18 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-17
347 - added bootmanager log links
348 - addressed root cause of IntegrityErrors ; big deal
349 - adjusted templates to accomodate fix for IntegrityErrors
350 - added session.flush() to bootman.py to write out ActionsRecords
351 - fixed policy to either pause penalties or apply them ; not both.
353 * Wed Jun 17 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-16
354 - Added Rpyc from 1.0 branch.
356 - add setup-agent for password protected keys.
357 - other minor improvements.
359 * Wed Jun 17 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-15
363 * Fri Jun 12 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-14
366 - added statistics dir
368 * Mon Jun 08 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-13
369 - remove plccache from controllers, all lookups from db.
370 - reformat emailTxt messags
371 - updated bootstates in bootman.py
373 * Tue Jun 02 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-12
374 - tag of latest changes.
375 - need to test end to end.
377 * Sat May 30 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-11
378 - big merge from the 2.0 branch
380 * Tue May 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-10
381 - minor improvements in rendering with sortable tables
383 * Tue May 19 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-9
385 * Fri May 15 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-8
386 - first draft with sortable tables + checkpoint
388 * Tue May 12 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-7
390 - fix for package name dependency
393 * Mon May 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-6
394 - add improved docs to the latest build and tag.
396 * Mon May 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-5
397 - add documentation hooks for adding in-line docs like NM and PLCAPI
399 * Fri May 01 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-4
400 - Rough pass over monitor-3.0 to allow it to work with 4.3 API.
401 - replaced GetNodeNetworks, nodeinterface_ids and using new bootstates
402 - 'safeboot', 'failboot', 'reinstall', etc.
404 * Tue Apr 28 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-3
405 - same as 2.0-12 tag.
407 * Mon Apr 27 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-2
408 - merge from 2.0, remove more zabbix code, simplify install, etc.
410 * Thu Apr 16 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-1
411 - major merge from 2.0 branch.
412 - ready to be updated with 4.3 and web changes.
414 * Fri Apr 03 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-9
415 - added new models to db.
416 - major updates throughout.
417 - better unification. needs an install test.
419 * Wed Apr 01 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-8
420 - removed old pkl database references.
421 - added blacklist to db model
422 - added fix to IntelAMT remoteControl to start an power-down node
424 - added global error count before bailing entirely.
426 * Fri Mar 27 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-7
428 - updated files that use db model
429 - updated web view based on node, site, and pcu states.
430 - added local mirror to zabbix Make file.
432 * Tue Mar 24 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-6
433 - added action view to gui
434 - added penalty_applied bit to db model.
436 * Fri Mar 20 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-5
437 - tag for updates to 2.0 db model
439 * Fri Mar 13 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-4
440 - splits reboot.py across pcucontrol and monitor modules
441 - moves command.py from monitor/util to pcucontrol/util
443 * Tue Mar 10 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-3
444 - add email exceptions
447 * Tue Mar 10 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-2
448 - getting the pcucontrol and findall.py scripts to work in an integrated
451 * Fri Feb 27 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-1
452 - preparing to make a 2.0 branch for monitor.
454 * Mon Jan 05 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-0
455 - new changes are significantly different, that I'm upping the number for clarity.
457 * Tue Nov 11 2008 Stephen Soltesz <soltesz@cs.princeton.edu>
459 - initial re-packaging
461 * Thu Dec 01 2005 Eugene Grigorjev <eugene.grigorjev@zabbix.com>
466 %define module_current_branch 2.0