blob: dc31c8e66619303438cba66883e4115bb4f5ac14 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#!/bin/bash
#
# Source function library.
. /etc/rc.conf
. /etc/rc.d/functions
# Check that networking is up.
if ck_daemon network; then
echo "Cannot run zabbix-agent without network - run network first"
exit
fi
start () {
stat_busy "Starting zabbix-agent"
/usr/sbin/zabbix_agentd &>/dev/null
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon zabbix_agentd
stat_done
fi
}
stop() {
stat_busy "Stopping zabbix-agent"
killall zabbix_agentd
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon zabbix_agentd
stat_done
fi
}
# See how we were called.
case $1 in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $"Usage: zabbix-agent {start|stop|restart}"
exit 1
esac
exit $RETVAL
|