Репозитории ALT
S: | 6.0.22-alt1 |
D: | 1.4.1-alt1.svn.4403 |
5.1: | 1.8.18-alt0.M51.1 |
4.1: | 1.6.4-alt0.1.svn.7369.M41.1 |
4.0: | 1.8-alt0.svn.8618.M40.1 |
3.0: | |
+backports: | 1.1.7-alt0.M30.1 |
Группа :: Мониторинг
Пакет: zabbix
Главная Изменения Спек Патчи Исходники Загрузить Gear Bugs and FR Repocop
#!/bin/sh
#
# zabbix_agentd This script starts and stops zabix_agent service
#
# chkconfig: - 90 10
# description: the zabbix network monitor agent
# processname: zabbix_agentd
# config: /etc/zabbix/zabbix_agentd.conf
# pidfile: /var/run/zabbix/zabbix_agentd.pid
# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
PIDFILE=/var/run/zabbix/zabbix_agentd.pid
LOCKFILE=/var/lock/subsys/zabbix_agentd
RETVAL=0
start()
{
check_rundir
get_status >/dev/null
if [ $RETVAL -eq 1 ]; then
echo "Removing stale pidfile"
rm -f "$PIDFILE"
fi
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user zabbix -- zabbix_agentd
RETVAL=$?
return $RETVAL
}
stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user zabbix -- zabbix_agentd
RETVAL=$?
return $RETVAL
}
restart()
{
stop
sleep 2
start
}
reload()
{
msg_reloading template
stop_daemon --pidfile "$PIDFILE" --expect-user zabbix -HUP -- zabbix_agentd
RETVAL=$?
return $RETVAL
}
get_status()
{
status --pidfile "$PIDFILE" --expect-user zabbix -- zabbix_agentd
RETVAL=$?
}
check_rundir()
{
if [ ! -d /var/run/zabbix ]; then
mkdir -p -m 0775 /var/run/zabbix
chown root:zabbix /var/run/zabbix
fi
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
condreload)
if [ -e "$LOCKFILE" ]; then
reload
fi
;;
status)
get_status
;;
*)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}"
RETVAL=1
esac
exit $RETVAL