View Full Version : RedHat/Fedora zabbix.spec or init files??
welshpjw
07-06-2005, 18:40
So, looks like the zabbix.spec files are entirely geared toward SUSE :eek: ;) and someone is somewhat actively maintaining it. Does anyone have (and want to contribute) updated RedHat/Fedora working zabbix.spec or init files? I have hacked my way through both groups, but not in a way that will work for the SUSE peeps.
The zabbix.spec, however has been left behind in the 1.1aplha6 version world as a hardcoded "version".
Just as a note to all of you "rpmbuild -tb" RedHat/Fedora dorks (like me), I have had to
1. extract the source
2. fix the .spec (source,version, configure,pre,post sections)
3. fix the init's
4. re-tar
5. rpmbuild -tb
Still a couple of minor issues, however like with the .log and .pid files.
Just looking for a better brain to have done these things "right" instead of the cr@p I put together ;)
I'm working mostly with Fedora, so I'll put my .spec's and some other stuff up tomorrow. Can't say they're not "cr@p", but they work :)
By the way, is anyone here with good automake/autoconf experience? I'd need a hand with automake scripts, I have no good understanding how it works.
Many thanks.
welshpjw
08-06-2005, 16:11
Alexei: Sorry I'm not a programmer and I don't play one on TV ;) . I would be useless without Google for most of the compiling problems I have, so I would not be a any help with automake/autoconf.
araw: I look forward to your info/input! I'm sure it't better than what I have done to the .spec and init files...
well i was looking for init scripts that work with chkconfig today, and ended up composing these 2 scripts that can be found here (http://www.nytefyre.net/~greg/zabbix_rh_init.tgz). Mind you they have only been tested on rhel4 (i'll probably check rhel3 next week, and probably core3 and 4 as well). This is my first time writing them, but i played with them a bit and they seem to be fully functional, and look/behave like many of the native init scripts, or atleast that was the goal.
-xaeth
welshpjw
09-07-2005, 04:56
Cool! Thank you very much! I too like to use chkconfig when I have no provided .spec files.
greypanda
11-07-2005, 01:57
I have been out of the Zabbix club for a couple of years. I see that my Redhat 8.0 init scripts are still in the misc directory. I'll see if I can get them updated to Fedora 4 in the next couple of weeks. I have used them on Fedora by just changing the "sucker" to "server".
John Crunk
i had the qmail and mysql monitors stop working on my boxes (twice and once respectively), and zabbix had a huge amount of bindings in the TIME_WAIT state, so it took killing the application and leaving it down to get everything back up, but the startup script didn't accomidate for port already bound ( i think named was having this issue on rhel3 as well), so I am gonna look into that.
But anyways... it seems to be just as functional on rhel3/4 and fc3/4.
I've created some simplified init.d scripts for RedHat ES 4. Basically as root just copy the two scripts into the /etc/init.d directory removing the extenstion. Then just run
# chkconfig --add zabbixServerd
# chkconfig --add zabbixAgentd
to have them start on boot up
# chkconfig zabbixServerd on
# chkconfig zabbixAgentd on
from there on out you can
service zabbixServerd {start|stop|restart|condrestart|status}
service zabbixAgentd {start|stop|restart|condrestart|status}
zabbixServerd:
#!/bin/bash
#
# Zabbix Startup script for the Zabbix Server
#
# chkconfig: - 99 02
# description: Zabbix network and host monitoring
# processname: zabbix_server
# config: /etc/zabbix/zabbix_server.conf
# pidfile: /var/tmp/zabbix_server.pid
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/zabbix_server ]; then
. /etc/sysconfig/zabbix_server
fi
server_cfgfile=/etc/zabbix/zabbix_server.conf
pidfile=${PIDFILE-/var/tmp/zabbix_server.pid}
zabbix_server=${ZABBIX_SERVER-/usr/local/bin/zabbix_server}
prog=zabbix_server
start() {
echo -n $"Starting $prog: "
daemon $zabbix_server
RETVAL=$?
echo
[ $RETVAL = 0 ]
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $zabbix_server
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${pidfile}
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $zabbix_server
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f ${pidfile} ] ; then
stop
start
fi
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL
zabbixAgentd:
#!/bin/bash
#
# Zabbix Startup script for the Zabbix Server
#
# chkconfig: - 99 02
# description: Zabbix network and host monitoring
# processname: zabbix_server
# config: /etc/zabbix/zabbix_server.conf
# pidfile: /var/tmp/zabbix_server.pid
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/zabbix_agentd ]; then
. /etc/sysconfig/zabbix_agentd
fi
agentd_cfgfile=/etc/zabbix/zabbix_agentd.conf
pidfile=${PIDFILE-/var/tmp/zabbix_agentd.pid}
zabbix_agentd=${ZABBIX_AGENTD-/usr/local/bin/zabbix_agentd}
prog=zabbix_agentd
start() {
echo -n $"Starting $prog: "
daemon $zabbix_agentd
RETVAL=$?
echo
[ $RETVAL = 0 ]
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc $zabbix_agentd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${pidfile}
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status $zabbix_agentd
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f ${pidfile} ] ; then
stop
start
fi
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL
johanpre44
26-04-2006, 09:07
Just wondering if any of you did the rpm yet? Seems like the init scripts are sorted out though.
Hi
See thread: http://www.zabbix.com/forum/showthread.php?t=3283
Areg