[hobbit] Initscript for Suse?

Andreas Kunberger andreas.kunberger at itv-denkendorf.de
Tue Jan 26 08:52:35 CET 2010


Am 25.01.2010 17:04, schrieb Reinartz Ralf AII.Pforzheim:
> Hello all,
> 
> Did anyone build an initscript for Suse 11.x for the Xymon Server?
> Unfortunally the Debian Scripts are a little bit different from the Suses Way.
> 
> If not, we'll try to make one.
> 
> Thanks
> 
> Ralf
> 
> 
> 

Hello,

I use the following script:
==================================
#! /bin/sh
#
# xymon           This shell script takes care of starting and stopping
#                 xymon(the former Hobbit network monitor)
#
# chkconfig: 2345 80 20
# description: xymon is a network monitoring tool that allows \
# you to monitor hosts and services. The monitor status is available \
# via a webpage.

### BEGIN INIT INFO
# Provides:       yxmon
# Required-Start: $remote_fs
# Should-Start: $named
# Required-Stop:
# Default-Start:  3 5
# Default-Stop:
# Description:    Start xymon monitoring
### END INIT INFO


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

test -x $DAEMON || exit 0

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

set -e

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

exit 0
==================================

mfg
Andreas

-- 

Institut für Textil- und Verfahrenstechnik
der Deutschen Institute für Textil- und Faserforschung Denkendorf



More information about the Xymon mailing list