starting xymon at boot time

Nelson Amaral amaral8011 at googlemail.com
Tue Mar 30 10:18:21 CEST 2010


Hi,

i mange to get a few things together to start xymon at boot time, see below
for the resulting script

this is for centos 5.4,  please feel fre to change things to suite you
distro

enjoy

first is the server start script

and the second is the client script


#######################################

#! /bin/sh
#
# xymon           This shell script takes care of starting and stopping
#                 xymon(the xymon network monitor)
#
# copy this script to /etc/init.d/ with the name xymon
# then do
# chmod 755 /etc/rc.d/init.d/xymon
# chkconfig xymon on
# description: xymon is a network monitoring tool that allows \
# you to monitor hosts and services. The monitor status is available \
# via a webpage.

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/home/xymon/server/hobbit.sh
NAME=xymon
DESC=xymon

test -x $DAEMON || exit 0

# Include xymon defaults if available
if [ -f /etc/default/hobbit ] ; then
        . /etc/default/hobbit
fi

set -e

case "$1" in
  start)
        echo -n "Starting $DESC: "
        su -c "$DAEMON start" - xymon
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        su -c "$DAEMON stop" - xymon
        echo "$NAME."
        ;;
  reload|force-reload)
        echo "Reloading $DESC configuration files."
        su -c "$DAEMON reload" - xymon
        echo "$NAME."
          ;;
  restart)
        echo -n "Restarting $DESC: "
        su -c "$DAEMON restart" - xymon
        echo "$NAME."
        ;;
  rotate)
        echo -n "Rotating logs for $DESC: "
        su -c "$DAEMON rotate" - xymon
        echo "$NAME."
        ;;
  *)
        N=/etc/init.d/$NAME
        # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0





client script




#############################################

#! /bin/sh
#
# xymon           This shell script takes care of starting and stopping
#                 xymon(the xymon network monitor)
#
# copy this script to /etc/init.d/ with the name xymon
# then do
# chmod 755 /etc/rc.d/init.d/xymon
# chkconfig xymon on
# description: xymon is a network monitoring tool that allows \
# you to monitor hosts and services. The monitor status is available \
# via a webpage.

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/home/xymon/client/runclient.sh
NAME=xymon
DESC=xymon

test -x $DAEMON || exit 0

# Include xymon defaults if available
if [ -f /etc/default/hobbit ] ; then
        . /etc/default/hobbit
fi

set -e

case "$1" in
  start)
        echo -n "Starting $DESC: "
        su -c "$DAEMON start" - xymon
        echo "$NAME."
        ;;
  stop)
        echo -n "Stopping $DESC: "
        su -c "$DAEMON stop" - xymon
        echo "$NAME."
        ;;
  reload|force-reload)
        echo "Reloading $DESC configuration files."
        su -c "$DAEMON reload" - xymon
        echo "$NAME."
          ;;
  restart)
        echo -n "Restarting $DESC: "
        su -c "$DAEMON restart" - xymon
        echo "$NAME."
        ;;
  rotate)
        echo -n "Rotating logs for $DESC: "
        su -c "$DAEMON rotate" - xymon
        echo "$NAME."
        ;;
  *)
        N=/etc/init.d/$NAME
        # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0








-- 
Kind regards

Nelson Amaral
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20100330/cbaca758/attachment.html>


More information about the Xymon mailing list