1 #! /bin/sh
2 #
3 # xymon           This shell script takes care of starting and stopping
4 #                 xymon (the Xymon network monitor)
5 #
6 # chkconfig: 2345 80 20
7 # description: Xymon  is a network monitoring tool that allows \
8 # you to monitor hosts and services. The monitor status is available \
9 # via a webpage.
10 
11 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
12 DAEMON=/usr/lib/xymon/server/bin/xymon.sh
13 NAME=xymon
14 DESC=Xymon
15 
16 test -x $DAEMON || exit 0
17 
18 # Include Xymon defaults if available
19 if [ -f /etc/default/xymon ] ; then
20 	. /etc/default/xymon
21 fi
22 
23 set -e
24 
25 case "$1" in
26   start)
27 	echo -n "Starting $DESC: "
28 	su -c "$DAEMON start" - xymon
29 	echo "$NAME."
30 	;;
31   stop)
32 	echo -n "Stopping $DESC: "
33 	su -c "$DAEMON stop" - xymon
34 	echo "$NAME."
35 	;;
36   status)
37 	su -c "$DAEMON status" - xymon
38 	;;
39   reload|force-reload)
40 	echo "Reloading $DESC configuration files."
41 	su -c "$DAEMON reload" - xymon
42 	echo "$NAME."
43 	  ;;
44   restart)
45 	echo -n "Restarting $DESC: "
46 	su -c "$DAEMON restart" - xymon
47 	echo "$NAME."
48 	;;
49   rotate)
50 	echo -n "Rotating logs for $DESC: "
51 	su -c "$DAEMON rotate" - xymon
52 	echo "$NAME."
53 	;;
54   *)
55 	N=/etc/init.d/$NAME
56 	# echo "Usage: $N {start|stop|restart|status|reload|force-reload}" >&2
57 	echo "Usage: $N {start|stop|restart|status|force-reload}" >&2
58 	exit 1
59 	;;
60 esac
61 
62 exit 0
63 
64