The following are simple wrapper scripts for the Xymon server and client that will allow you to automatically start them during boot-up, just as you would any other standard unix service:
cd /etc/rc.d/init.d/xymon
nano xymon
Xymon Server Code
#!/bin/bash
##
# chkconfig: 345 55 25
# description: Xymon Server Monitor
#
# source function library
. /etc/rc.d/init.d/functionscase “$1″ in
start)
echo -n “Starting Xymon:”
su – monitor -c “cd /home/monitor/server;./hobbit.sh start” >> /dev/null 2>&1
echo_success
echo
;;
stop)
echo -n “Stopping Xymon:”
su – monitor -c “cd /home/monitor/server;./hobbit.sh stop” >> /dev/null 2>&1
echo_success
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo “usage: $0 [start|stop|restart]”
esac
exit 0
Xymon Client Code
#!/bin/bash
##
# chkconfig: 345 55 25
# description: Xymon Server Monitor Client
#
# source function library
. /etc/rc.d/init.d/functionscase “$1″ in
start)
echo -n “Starting Xymon Client:”
su – monitor -c “cd /home/monitor/client;./runclient.sh start” >> /dev/null 2>&1
echo_success
echo
;;
stop)
echo -n “Stopping Xymon Client:”
su – monitor -c “cd /home/monitor/client;./runclient.sh stop” >> /dev/null 2>&1
echo_success
echo
;;
restart)
$0 stop
$0 start
;;
*)
echo “usage: $0 [start|stop|restart]”
esac
exit 0
chmod 700 xymon
chkconfig xymon on