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 # quick and dirty fix for f12; loader would fail b/c of the lack of /lib/libm.a
82 %if "%{distro}" == "Fedora" && %{distrorelease} >= 12
83 ./configure --enable-agent
85 ./configure --enable-static --enable-agent
91 ./configure --enable-server --with-pgsql --with-net-snmp --with-libcurl
96 rm -fr $RPM_BUILD_ROOT
99 rm -fr $RPM_BUILD_ROOT
101 ################# SERVER
104 install -d %{buildroot}%{zabbix_docdir}
105 install -m 644 server/AUTHORS %{buildroot}%{zabbix_docdir}/AUTHORS
106 install -m 644 server/COPYING %{buildroot}%{zabbix_docdir}/COPYING
107 install -m 644 server/NEWS %{buildroot}%{zabbix_docdir}/NEWS
108 install -m 644 server/README %{buildroot}%{zabbix_docdir}/README
111 install -d %{buildroot}%{zabbix_bindir}
112 install -s -m 755 server/src/zabbix_server/zabbix_server %{buildroot}%{zabbix_bindir}/zabbix_server
115 install -d %{buildroot}%{zabbix_confdir}
116 install -m 755 server/misc/conf/zabbix_server.conf %{buildroot}%{zabbix_confdir}/zabbix_server.conf
117 install -d %{buildroot}/etc/zabbix
118 install -m 755 server/misc/conf/zabbix_server.conf %{buildroot}/etc/zabbix
120 # copy startup script
121 install -d %{buildroot}%{zabbix_initdir}
122 install -m 755 server/misc/init.d/fedora/core/zabbix_server %{buildroot}%{zabbix_initdir}/zabbix_server
124 install -d %{buildroot}%{zabbix_datadir}
125 cp -r server/create %{buildroot}%{zabbix_datadir}
127 ################# CLIENT
129 install -d %{buildroot}%{zabbix_bindir}
130 install -s -m 755 client/src/zabbix_agent/zabbix_agentd %{buildroot}%{zabbix_bindir}/zabbix_agentd
133 install -d %{buildroot}%{zabbix_confdir}
134 install -m 755 client/misc/conf/zabbix_agentd.conf %{buildroot}%{zabbix_confdir}/zabbix_agentd.conf
135 install -d %{buildroot}/etc/zabbix
136 install -m 755 client/misc/conf/zabbix_agentd.conf %{buildroot}/etc/zabbix
138 # copy startup script
139 install -d %{buildroot}%{zabbix_initdir}
140 install -m 755 client/misc/init.d/fedora/core/zabbix_agentd %{buildroot}%{zabbix_initdir}/zabbix_agentd
142 ################# GUI
144 install -d %{buildroot}%{zabbix_webdir}
145 cp -r frontends/php/* %{buildroot}%{zabbix_webdir}
148 # create ZABBIX group
149 if [ -z "`grep zabbix /etc/group`" ]; then
150 /usr/sbin/groupadd zabbix >/dev/null 2>&1
154 if [ -z "`grep zabbix /etc/passwd`" ]; then
155 /usr/sbin/useradd -g zabbix zabbix >/dev/null 2>&1
158 # configure ZABBIX agentd daemon
159 TMP_FILE=`mktemp $TMPDIR/zbxtmpXXXXXX`
161 # TODO: setup Server=, Hostname=,
162 SERVER=`grep PLC_MONITOR_HOST /etc/planetlab/plc_config | tr "'" ' ' | awk '{print $2}'`
163 if [ -z "$SERVER" ] ; then
164 SERVER=128.112.139.116
167 sed -e "s#Hostname=.*#Hostname=$HOST#g" \
168 -e "s#Server=.*#Server=$SERVER#g" \
169 -e "s#PidFile=/var/tmp/zabbix_agentd.pid#PidFile=%{zabbix_piddir}/zabbix_agentd.pid#g" \
170 -e "s#LogFile=/tmp/zabbix_agentd.log#LogFile=%{zabbix_logdir}/zabbix_agentd.log#g" \
171 %{zabbix_confdir}/zabbix_agentd.conf > $TMP_FILE
172 cat $TMP_FILE > %{zabbix_confdir}/zabbix_agentd.conf
174 cp %{zabbix_confdir}/zabbix_agentd.conf /etc/zabbix/
175 # TODO: copy to /etc/zabbix/
177 sed -e "s#BASEDIR=/opt/zabbix#BASEDIR=%{_prefix}#g" \
178 -e "s#PIDFILE=/var/tmp/zabbix_agentd.pid#PIDFILE=%{zabbix_piddir}/zabbix_agentd.pid#g" \
179 %{zabbix_initdir}/zabbix_agentd > $TMP_FILE
180 cat $TMP_FILE > %{zabbix_initdir}/zabbix_agentd
182 # NOTE: Run every runlevel as soon as possible, and stop as late as possible
183 cp %{zabbix_initdir}/zabbix_agentd %{_initrddir}
184 sed -i -e "s#chkconfig: - 90 10#chkconfig: 2345 12 90#g" \
185 %{_initrddir}/zabbix_agentd
189 chkconfig --add zabbix_agentd
190 chkconfig zabbix_agentd on
191 service zabbix_agentd start
195 # create ZABBIX group
196 if [ -z "`grep zabbix /etc/group`" ]; then
197 /usr/sbin/groupadd zabbix >/dev/null 2>&1
201 if [ -z "`grep zabbix /etc/passwd`" ]; then
202 /usr/sbin/useradd -g zabbix zabbix >/dev/null 2>&1
205 # configure ZABBIX server daemon
206 TMP_FILE=`mktemp $TMPDIR/zbxtmpXXXXXX`
208 sed -e "s#AlertScriptsPath=/home/zabbix/bin/#AlertScriptsPath=%{zabbix_bindir}/#g" \
209 -e "s#PidFile=/var/tmp/zabbix_server.pid#PidFile=%{zabbix_piddir}/zabbix_server.pid#g" \
210 -e "s#LogFile=/tmp/zabbix_server.log#LogFile=%{zabbix_logdir}/zabbix_server.log#g" \
211 -e "s|#DBPassword|DBPassword|g" \
212 %{zabbix_confdir}/zabbix_server.conf > $TMP_FILE
213 cat $TMP_FILE > %{zabbix_confdir}/zabbix_server.conf
214 mkdir -p %{_sysconfdir}/zabbix
215 cp %{zabbix_confdir}/zabbix_server.conf %{_sysconfdir}/zabbix/
217 sed -e "s#BASEDIR=/opt/zabbix#BASEDIR=%{_prefix}#g" \
218 -e "s#PIDFILE=/var/tmp/zabbix_server.pid#PIDFILE=%{zabbix_piddir}/zabbix_server.pid#g" \
219 %{zabbix_initdir}/zabbix_server > $TMP_FILE
220 cat $TMP_FILE > %{zabbix_initdir}/zabbix_server
223 # NOTE: Run every runlevel as soon as possible, and stop as late as possible
224 cp %{zabbix_initdir}/zabbix_server %{_initrddir}
225 sed -i -e "s#chkconfig: - 90 10#chkconfig: 2345 12 90#g" \
226 %{_initrddir}/zabbix_server
228 chkconfig --add zabbix_server
229 chkconfig zabbix_server on
232 # Setup the necessary values in /etc/php.ini
233 # NOTE: Zabbix requires max_execution_time to be 300 seconds
234 # NOTE: Zabbix requires a default date.timezone
236 # also edit /var/www/html/zabbix/conf/zabbix.conf.php
237 # touch /var/www/html/zabbix/conf/zabbix.conf.php
238 # chmod 644 /var/www/html/zabbix/conf/zabbix.conf.php
241 TMP_FILE=`mktemp $TMPDIR/zbxtmpXXXXXX`
242 sed -e "s#;date.timezone =#date.timezone = UTC#g" \
243 -e "s#max_execution_time = 30 #max_execution_time = 300 #g" \
244 %{_sysconfdir}/php.ini > $TMP_FILE
245 cat $TMP_FILE > %{_sysconfdir}/php.ini
249 rm -f %{zabbix_piddir}/zabbix_server.pid
250 rm -f %{zabbix_logdir}/zabbix_server.log
252 rm -f %{zabbix_piddir}/zabbix_agentd.pid
253 rm -f %{zabbix_logdir}/zabbix_agentd.log
256 %defattr(-,root,root)
258 %dir %attr(0755,root,root) %{zabbix_confdir}
259 %attr(0644,root,root) %config(noreplace) %{zabbix_confdir}/zabbix_agentd.conf
261 %dir %attr(0755,root,root) %{zabbix_bindir}
262 %attr(0755,root,root) %{zabbix_bindir}/zabbix_agentd
264 %dir %attr(0755,root,root) %{zabbix_initdir}
265 %attr(0755,root,root) %{zabbix_initdir}/zabbix_agentd
267 %config /etc/zabbix/zabbix_agentd.conf
270 %defattr(-,root,root)
272 %dir %attr(0755,root,root) %{zabbix_docdir}
273 %attr(0644,root,root) %{zabbix_docdir}/AUTHORS
274 %attr(0644,root,root) %{zabbix_docdir}/COPYING
275 %attr(0644,root,root) %{zabbix_docdir}/NEWS
276 %attr(0644,root,root) %{zabbix_docdir}/README
278 %dir %attr(0755,root,root) %{zabbix_confdir}
279 %attr(0644,root,root) %config(noreplace) %{zabbix_confdir}/zabbix_server.conf
281 %dir %attr(0755,root,root) %{zabbix_bindir}
282 %attr(0755,root,root) %{zabbix_bindir}/zabbix_server
284 %dir %attr(0755,root,root) %{zabbix_initdir}
285 %attr(0755,root,root) %{zabbix_initdir}/zabbix_server
287 %dir %attr(0755,root,root) %{zabbix_datadir}
288 %attr(0755,root,root) %{zabbix_datadir}/create/
290 %config /etc/zabbix/zabbix_server.conf
293 %defattr(-,root,root)
294 %dir %{zabbix_webdir}
298 * Fri May 27 2011 s s <soltesz@cs.princeton.edu> - monitor-3.1-4
299 - Fixes to spec file for monitor building
301 * Fri May 27 2011 s s <soltesz@cs.princeton.edu> - monitor-3.1-3
302 - fixing syntax errors
304 * Fri May 27 2011 s s <soltesz@cs.princeton.edu> - monitor-3.1-2
305 - Add better requirements list, work with TurboGears packaged by fedora,
306 - Remove some zabbix files
307 - Add a controllers_local.py for custom extensions
309 * Fri May 06 2011 s s <soltesz@cs.princeton.edu> - monitor-3.1-1
310 - last tag before some more major changes
312 * Thu May 20 2010 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-35
313 - Add CSV link on Advanced query
314 - Preparing to branch
316 * Wed May 12 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-34
317 - * copy selections to clipbord on Advanced Query page
318 - * RPM Pattern as regexp
321 * Tue Apr 27 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-33
322 - handle hostname changes
324 * Tue Apr 20 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-32
325 - from this version, suitable for 5.0
326 - requires bootcd with the new 5.0 naming style 3-part nodefamily
328 * Mon Apr 12 2010 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-31
329 - added fix for node delete/add causing conflicts in MyOps db.
330 - added statistics scripts
332 * Thu Jan 21 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-30
333 - * fix paths for automate script
335 * Tue Dec 22 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-29
336 - - separate pcucontrol as an svn module
337 - - restore easy_instal back into post install stage of server-deps
338 - - template imporovements for web interface
340 * Thu Dec 17 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-28
341 - do not need buildrequires. a new tag to fix centos builds
343 * Thu Dec 17 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-27
344 - fix rpm build issues
346 * Wed Dec 16 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-26
347 - to many changes, but mostly moved stuff around. there are some small fixes here and there.
349 * Fri Nov 20 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-25
350 - add option for site status to include both node & pcu status
351 - improve ticket handling
352 - template gadget.xml for a site-specific google-gadget summary
354 * Thu Oct 22 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-24
357 * Mon Oct 19 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-23
358 - - remove monitor-client.cron
359 - - remove unused monitor-client init script
360 - - fix UP/DOWN summary on nodes page.
361 - - make node page display all nodes by default
362 - - add boot_server field
363 - - add myops_ssh_key to the keychain
364 - - use ext_consortium_id to distinguish pending sites.
366 * Fri Oct 09 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-22
367 - show/hide advance query form.
369 * Thu Sep 24 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-21
370 - fixed pause_penalty bug.
371 - fixed IPAL pcucontrol bug
372 - fixed bootman tunnel setup bug (occurred in rare cases)
374 - added BootmanSequenceRecords to separate config data from source code
375 - added get/setBootmanSequence(s) to xmlrpc API
377 * Fri Sep 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-20
379 - added bm log collection and optional integration with BootManager's log Upload()
380 - added iptables_status
381 - expanded advanced query
382 - added differentiated bootmanager_restore actions so that actionsummary displays
383 - counts for each kind of bootmanager action
384 - added pcuerror notices (for mis-configurations) in addition to pcufailed notices
385 - added plain-text options for query page by adding tg_format=plain to URL
386 - fixed cross-module reference that prevented pcucontrol for working with RebootNodeWithPCU() api call.
387 - fixed a bug in determining whether comon's dir was running on a node
389 * Mon Aug 17 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-19
391 - adds multiple features and web changes
392 - adds new fields to db
394 - general improvements otherwise
396 * Sun Jun 28 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-18
398 - improved templates and views
399 - cleaned controller code for web
400 - added IPMI requirement to pcucontrol package.
402 * Thu Jun 18 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-17
403 - added bootmanager log links
404 - addressed root cause of IntegrityErrors ; big deal
405 - adjusted templates to accomodate fix for IntegrityErrors
406 - added session.flush() to bootman.py to write out ActionsRecords
407 - fixed policy to either pause penalties or apply them ; not both.
409 * Wed Jun 17 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-16
410 - Added Rpyc from 1.0 branch.
412 - add setup-agent for password protected keys.
413 - other minor improvements.
415 * Wed Jun 17 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-15
419 * Fri Jun 12 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-14
422 - added statistics dir
424 * Mon Jun 08 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-13
425 - remove plccache from controllers, all lookups from db.
426 - reformat emailTxt messags
427 - updated bootstates in bootman.py
429 * Tue Jun 02 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-12
430 - tag of latest changes.
431 - need to test end to end.
433 * Sat May 30 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-11
434 - big merge from the 2.0 branch
436 * Tue May 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-10
437 - minor improvements in rendering with sortable tables
439 * Tue May 19 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-9
441 * Fri May 15 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-8
442 - first draft with sortable tables + checkpoint
444 * Tue May 12 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-7
446 - fix for package name dependency
449 * Mon May 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-6
450 - add improved docs to the latest build and tag.
452 * Mon May 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-5
453 - add documentation hooks for adding in-line docs like NM and PLCAPI
455 * Fri May 01 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-4
456 - Rough pass over monitor-3.0 to allow it to work with 4.3 API.
457 - replaced GetNodeNetworks, nodeinterface_ids and using new bootstates
458 - 'safeboot', 'failboot', 'reinstall', etc.
460 * Tue Apr 28 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-3
461 - same as 2.0-12 tag.
463 * Mon Apr 27 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-2
464 - merge from 2.0, remove more zabbix code, simplify install, etc.
466 * Thu Apr 16 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-1
467 - major merge from 2.0 branch.
468 - ready to be updated with 4.3 and web changes.
470 * Fri Apr 03 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-9
471 - added new models to db.
472 - major updates throughout.
473 - better unification. needs an install test.
475 * Wed Apr 01 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-8
476 - removed old pkl database references.
477 - added blacklist to db model
478 - added fix to IntelAMT remoteControl to start an power-down node
480 - added global error count before bailing entirely.
482 * Fri Mar 27 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-7
484 - updated files that use db model
485 - updated web view based on node, site, and pcu states.
486 - added local mirror to zabbix Make file.
488 * Tue Mar 24 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-6
489 - added action view to gui
490 - added penalty_applied bit to db model.
492 * Fri Mar 20 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-5
493 - tag for updates to 2.0 db model
495 * Fri Mar 13 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-4
496 - splits reboot.py across pcucontrol and monitor modules
497 - moves command.py from monitor/util to pcucontrol/util
499 * Tue Mar 10 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-3
500 - add email exceptions
503 * Tue Mar 10 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-2
504 - getting the pcucontrol and findall.py scripts to work in an integrated
507 * Fri Feb 27 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-1
508 - preparing to make a 2.0 branch for monitor.
510 * Mon Jan 05 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-0
511 - new changes are significantly different, that I'm upping the number for clarity.
513 * Tue Nov 11 2008 Stephen Soltesz <soltesz@cs.princeton.edu>
515 - initial re-packaging
517 * Thu Dec 01 2005 Eugene Grigorjev <eugene.grigorjev@zabbix.com>
522 %define module_current_branch 3.0