Xymon Mailing List Archive search

starting xymon at boot time

2 messages in this thread

list Nelson Amaral · Tue, 30 Mar 2010 09:18:21 +0100 ·
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
list Buchan Milne · Tue, 30 Mar 2010 11:36:47 +0100 ·
quoted from Nelson Amaral
On Tuesday, 30 March 2010 09:18:21 Nelson Amaral wrote:
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
Packages are already available for RHEL5/CentOS 5 are already available, with 
init scripts.

There is also an example script in the "rpm" subdirectory of the source.

Regards,
Buchan