Tagging module Monitor - Monitor-2.0-1
[monitor.git] / zabbix.spec
index fb7cb8c..7f80e90 100644 (file)
@@ -3,7 +3,7 @@
 %define _prefix                /usr/local/zabbix
 
 Name:          zabbix
-Version:       1.6.1
+Version:       1.6.2
 Release:       1
 Group:         System Environment/Daemons
 License:       GPL
@@ -11,7 +11,7 @@ Summary:      ZABBIX network monitor server
 Vendor:                ZABBIX SIA
 URL:           http://www.zabbix.org
 Packager:      Eugene Grigorjev <eugene.grigorjev@zabbix.com>
-Source:                zabbix-1.6.1.tar.gz
+Source:                zabbix-%{version}.tar.gz
 
 Autoreq:       no
 Buildroot:     %{_tmppath}/%{name}-%{version}-%{release}-buildroot
@@ -66,7 +66,7 @@ Requires: postgresql-server
 The ZABBIX gui frontend
 
 %prep
-%setup -n zabbix-1.6.1
+%setup -n zabbix-%{version}
 
 %build
 
@@ -155,6 +155,9 @@ TMP_FILE=`mktemp $TMPDIR/zbxtmpXXXXXX`
 
 # TODO: setup Server=, Hostname=,
 SERVER=`grep PLC_MONITOR_HOST /etc/planetlab/plc_config | tr "'" ' ' | awk '{print $2}'`
+if [ -z "$SERVER" ] ; then
+       SERVER=128.112.139.116
+fi
 HOST=`hostname`
 sed    -e "s#Hostname=.*#Hostname=$HOST#g" \
        -e "s#Server=.*#Server=$SERVER#g" \
@@ -170,12 +173,17 @@ sed       -e "s#BASEDIR=/opt/zabbix#BASEDIR=%{_prefix}#g" \
        -e "s#PIDFILE=/var/tmp/zabbix_agentd.pid#PIDFILE=%{zabbix_piddir}/zabbix_agentd.pid#g" \
        %{zabbix_initdir}/zabbix_agentd > $TMP_FILE
 cat $TMP_FILE > %{zabbix_initdir}/zabbix_agentd
-# TODO: copy to /etc/init.d/
+
+# NOTE: Run every runlevel as soon as possible, and stop as late as possible
 cp %{zabbix_initdir}/zabbix_agentd %{_initrddir}
+sed    -i -e "s#chkconfig: - 90 10#chkconfig: 2345 12 90#g" \
+       %{_initrddir}/zabbix_agentd
 
 rm -f $TMP_FILE
 
+chkconfig --add zabbix_agentd 
 chkconfig zabbix_agentd on
+service zabbix_agentd start
 
 %post server
 
@@ -195,6 +203,7 @@ TMP_FILE=`mktemp $TMPDIR/zbxtmpXXXXXX`
 sed    -e "s#AlertScriptsPath=/home/zabbix/bin/#AlertScriptsPath=%{zabbix_bindir}/#g" \
        -e "s#PidFile=/var/tmp/zabbix_server.pid#PidFile=%{zabbix_piddir}/zabbix_server.pid#g" \
        -e "s#LogFile=/tmp/zabbix_server.log#LogFile=%{zabbix_logdir}/zabbix_server.log#g" \
+       -e "s|#DBPassword|DBPassword|g" \
        %{zabbix_confdir}/zabbix_server.conf > $TMP_FILE
 cat $TMP_FILE > %{zabbix_confdir}/zabbix_server.conf
 mkdir -p %{_sysconfdir}/zabbix
@@ -204,10 +213,14 @@ sed       -e "s#BASEDIR=/opt/zabbix#BASEDIR=%{_prefix}#g" \
        -e "s#PIDFILE=/var/tmp/zabbix_server.pid#PIDFILE=%{zabbix_piddir}/zabbix_server.pid#g" \
        %{zabbix_initdir}/zabbix_server > $TMP_FILE
 cat $TMP_FILE > %{zabbix_initdir}/zabbix_server
-cp %{zabbix_initdir}/zabbix_server %{_initrddir}
-
 rm -f $TMP_FILE
 
+# NOTE: Run every runlevel as soon as possible, and stop as late as possible
+cp %{zabbix_initdir}/zabbix_server %{_initrddir}
+sed    -i -e "s#chkconfig: - 90 10#chkconfig: 2345 12 90#g" \
+       %{_initrddir}/zabbix_server 
+
+chkconfig --add zabbix_server
 chkconfig zabbix_server on
 
 %post gui
@@ -277,6 +290,12 @@ rm -f %{zabbix_logdir}/zabbix_agentd.log
 %{zabbix_webdir}
 
 %changelog
+* Fri Feb 27 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-1
+- preparing to make a 2.0 branch for monitor.
+
+* Mon Jan 05 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - Monitor-2.0-0
+- new changes are significantly different, that I'm upping the number for clarity.
+
 * Tue Nov 11 2008 Stephen Soltesz <soltesz@cs.princeton.edu>
 - 1.6.1
 - initial re-packaging