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 * Thu May 20 2010 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-35
299 - Add CSV link on Advanced query
300 - Preparing to branch
302 * Wed May 12 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-34
303 - * copy selections to clipbord on Advanced Query page
304 - * RPM Pattern as regexp
307 * Tue Apr 27 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-33
308 - handle hostname changes
310 * Tue Apr 20 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-32
311 - from this version, suitable for 5.0
312 - requires bootcd with the new 5.0 naming style 3-part nodefamily
314 * Mon Apr 12 2010 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-31
315 - added fix for node delete/add causing conflicts in MyOps db.
316 - added statistics scripts
318 * Thu Jan 21 2010 Talip Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-30
319 - * fix paths for automate script
321 * Tue Dec 22 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-29
322 - - separate pcucontrol as an svn module
323 - - restore easy_instal back into post install stage of server-deps
324 - - template imporovements for web interface
326 * Thu Dec 17 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-28
327 - do not need buildrequires. a new tag to fix centos builds
329 * Thu Dec 17 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-27
330 - fix rpm build issues
332 * Wed Dec 16 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-26
333 - to many changes, but mostly moved stuff around. there are some small fixes here and there.
335 * Fri Nov 20 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-25
336 - add option for site status to include both node & pcu status
337 - improve ticket handling
338 - template gadget.xml for a site-specific google-gadget summary
340 * Thu Oct 22 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-24
343 * Mon Oct 19 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-23
344 - - remove monitor-client.cron
345 - - remove unused monitor-client init script
346 - - fix UP/DOWN summary on nodes page.
347 - - make node page display all nodes by default
348 - - add boot_server field
349 - - add myops_ssh_key to the keychain
350 - - use ext_consortium_id to distinguish pending sites.
352 * Fri Oct 09 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-22
353 - show/hide advance query form.
355 * Thu Sep 24 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-21
356 - fixed pause_penalty bug.
357 - fixed IPAL pcucontrol bug
358 - fixed bootman tunnel setup bug (occurred in rare cases)
360 - added BootmanSequenceRecords to separate config data from source code
361 - added get/setBootmanSequence(s) to xmlrpc API
363 * Fri Sep 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-20
365 - added bm log collection and optional integration with BootManager's log Upload()
366 - added iptables_status
367 - expanded advanced query
368 - added differentiated bootmanager_restore actions so that actionsummary displays
369 - counts for each kind of bootmanager action
370 - added pcuerror notices (for mis-configurations) in addition to pcufailed notices
371 - added plain-text options for query page by adding tg_format=plain to URL
372 - fixed cross-module reference that prevented pcucontrol for working with RebootNodeWithPCU() api call.
373 - fixed a bug in determining whether comon's dir was running on a node
375 * Mon Aug 17 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-19
377 - adds multiple features and web changes
378 - adds new fields to db
380 - general improvements otherwise
382 * Sun Jun 28 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-18
384 - improved templates and views
385 - cleaned controller code for web
386 - added IPMI requirement to pcucontrol package.
388 * Thu Jun 18 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-17
389 - added bootmanager log links
390 - addressed root cause of IntegrityErrors ; big deal
391 - adjusted templates to accomodate fix for IntegrityErrors
392 - added session.flush() to bootman.py to write out ActionsRecords
393 - fixed policy to either pause penalties or apply them ; not both.
395 * Wed Jun 17 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-16
396 - Added Rpyc from 1.0 branch.
398 - add setup-agent for password protected keys.
399 - other minor improvements.
401 * Wed Jun 17 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-15
405 * Fri Jun 12 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-14
408 - added statistics dir
410 * Mon Jun 08 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-13
411 - remove plccache from controllers, all lookups from db.
412 - reformat emailTxt messags
413 - updated bootstates in bootman.py
415 * Tue Jun 02 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-12
416 - tag of latest changes.
417 - need to test end to end.
419 * Sat May 30 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-11
420 - big merge from the 2.0 branch
422 * Tue May 26 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-10
423 - minor improvements in rendering with sortable tables
425 * Tue May 19 2009 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - Monitor-3.0-9
427 * Fri May 15 2009 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - Monitor-3.0-8
428 - first draft with sortable tables + checkpoint
430 * Tue May 12 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-7
432 - fix for package name dependency
435 * Mon May 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-6
436 - add improved docs to the latest build and tag.
438 * Mon May 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-5
439 - add documentation hooks for adding in-line docs like NM and PLCAPI
441 * Fri May 01 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-4
442 - Rough pass over monitor-3.0 to allow it to work with 4.3 API.
443 - replaced GetNodeNetworks, nodeinterface_ids and using new bootstates
444 - 'safeboot', 'failboot', 'reinstall', etc.
446 * Tue Apr 28 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-3
447 - same as 2.0-12 tag.
449 * Mon Apr 27 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-2
450 - merge from 2.0, remove more zabbix code, simplify install, etc.
452 * Thu Apr 16 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-3.0-1
453 - major merge from 2.0 branch.
454 - ready to be updated with 4.3 and web changes.
456 * Fri Apr 03 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-9
457 - added new models to db.
458 - major updates throughout.
459 - better unification. needs an install test.
461 * Wed Apr 01 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-8
462 - removed old pkl database references.
463 - added blacklist to db model
464 - added fix to IntelAMT remoteControl to start an power-down node
466 - added global error count before bailing entirely.
468 * Fri Mar 27 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-7
470 - updated files that use db model
471 - updated web view based on node, site, and pcu states.
472 - added local mirror to zabbix Make file.
474 * Tue Mar 24 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-6
475 - added action view to gui
476 - added penalty_applied bit to db model.
478 * Fri Mar 20 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-5
479 - tag for updates to 2.0 db model
481 * Fri Mar 13 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-4
482 - splits reboot.py across pcucontrol and monitor modules
483 - moves command.py from monitor/util to pcucontrol/util
485 * Tue Mar 10 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-3
486 - add email exceptions
489 * Tue Mar 10 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-2
490 - getting the pcucontrol and findall.py scripts to work in an integrated
493 * Fri Feb 27 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-1
494 - preparing to make a 2.0 branch for monitor.
496 * Mon Jan 05 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-0
497 - new changes are significantly different, that I'm upping the number for clarity.
499 * Tue Nov 11 2008 Stephen Soltesz <soltesz@cs.princeton.edu>
501 - initial re-packaging
503 * Thu Dec 01 2005 Eugene Grigorjev <eugene.grigorjev@zabbix.com>
508 %define module_current_branch 3.0