[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
starting xymon at boot time
- To: hobbit (at) hswn.dk
- Subject: starting xymon at boot time
- From: Nelson Amaral <amaral8011 (at) googlemail.com>
- Date: Tue, 30 Mar 2010 09:18:21 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=MLR08+JP8xs2nrGpoR/BEW4UzYEG3u/4QNelKtWqO3A=; b=IcfrJOiqoASJxlM0ln3F2gsYc3HyNX1w+9aWWFkb3VzuEtqXXUC4NTwPRhV0f/3Qbk /JARdZAbhbjXKf89hHS4luBjvii7nZ2Sfruwu0xyEEL6RXK7jmx1+8g1/ZwImXe2EqJz BXEvrtabeVail3mgOiaaHat82/7VxTYRaoUCc=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=hupG+A/uSl5Brghuk53ochG3VvuUhcn9xCOKStdw+laTRfS2hNfw5qpk2Vxl4ruI/o nlsCpmi+ZqrL1vQ+kbTpPqGfTacweeDeRAQv9B0MHd4T39G5GvxLeoEgSwUfEbr3+3Fd msE30hP70Fxs2lUv2Yk/6rOx/T6SZuZZSNsm8=
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