Revision 7440,
1.4 KB
checked in by iwaim, 12 years ago
(diff) |
new: zabbix
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[7440] | 1 | #!/bin/bash |
---|
| 2 | # |
---|
| 3 | # /etc/rc.d/init.d/zabbix_agentd |
---|
| 4 | # |
---|
| 5 | # Starts the zabbix_agentd daemon |
---|
| 6 | # |
---|
| 7 | # chkconfig: - 95 5 |
---|
| 8 | # description: Zabbix Monitoring Agent |
---|
| 9 | # processname: zabbix_agentd |
---|
| 10 | # pidfile: /var/run/zabbix/zabbix_agentd.pid |
---|
| 11 | |
---|
| 12 | # Modified for Zabbix 2.0.0 |
---|
| 13 | # May 2012, Zabbix SIA |
---|
| 14 | # 2012-02-07: IWAI, Masaharu; modified for Vine Linux |
---|
| 15 | |
---|
| 16 | # Source function library. |
---|
| 17 | |
---|
| 18 | . /etc/init.d/functions |
---|
| 19 | |
---|
| 20 | RETVAL=0 |
---|
| 21 | prog="Zabbix Agent" |
---|
| 22 | ZABBIX_BIN="/usr/sbin/zabbix_agentd" |
---|
| 23 | |
---|
| 24 | if [ ! -x ${ZABBIX_BIN} ] ; then |
---|
| 25 | echo -n "${ZABBIX_BIN} not installed! " |
---|
| 26 | # Tell the user this has skipped |
---|
| 27 | exit 5 |
---|
| 28 | fi |
---|
| 29 | |
---|
| 30 | start() { |
---|
| 31 | echo -n $"Starting $prog: " |
---|
| 32 | daemon $ZABBIX_BIN |
---|
| 33 | RETVAL=$? |
---|
| 34 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zabbix_agentd |
---|
| 35 | echo |
---|
| 36 | } |
---|
| 37 | |
---|
| 38 | stop() { |
---|
| 39 | echo -n $"Stopping $prog: " |
---|
| 40 | killproc $ZABBIX_BIN |
---|
| 41 | RETVAL=$? |
---|
| 42 | [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zabbix_agentd |
---|
| 43 | echo |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | case "$1" in |
---|
| 47 | start) |
---|
| 48 | start |
---|
| 49 | ;; |
---|
| 50 | stop) |
---|
| 51 | stop |
---|
| 52 | ;; |
---|
| 53 | reload|restart) |
---|
| 54 | stop |
---|
| 55 | sleep 10 |
---|
| 56 | start |
---|
| 57 | RETVAL=$? |
---|
| 58 | ;; |
---|
| 59 | condrestart) |
---|
| 60 | if [ -f /var/lock/subsys/zabbix_agentd ]; then |
---|
| 61 | stop |
---|
| 62 | start |
---|
| 63 | fi |
---|
| 64 | ;; |
---|
| 65 | status) |
---|
| 66 | status $ZABBIX_BIN |
---|
| 67 | RETVAL=$? |
---|
| 68 | ;; |
---|
| 69 | *) |
---|
| 70 | echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}" |
---|
| 71 | exit 1 |
---|
| 72 | esac |
---|
| 73 | |
---|
| 74 | exit $RETVAL |
---|
Note: See
TracBrowser
for help on using the repository browser.