diff options
author | Cecil <knoppmyth@gmail.com> | 2011-12-09 17:18:27 (GMT) |
---|---|---|
committer | Cecil <knoppmyth@gmail.com> | 2011-12-09 17:18:27 (GMT) |
commit | c034db2c880091379f7e58c2938a9689d78fbaa9 (patch) | |
tree | 8a074205a2f3bf6ee7fb5945c53e1a1618d41973 /abs/core/runit-scripts/runitscripts/services/xymon-client/run | |
parent | 73b42144585c603fc64e7b1d6a126ceb7c486870 (diff) | |
parent | b0c5755ade92ee5b76a6d56248e64254876bc931 (diff) | |
download | linhes_pkgbuild-c034db2c880091379f7e58c2938a9689d78fbaa9.zip linhes_pkgbuild-c034db2c880091379f7e58c2938a9689d78fbaa9.tar.gz linhes_pkgbuild-c034db2c880091379f7e58c2938a9689d78fbaa9.tar.bz2 |
Merge branch 'testing' of ssh://cesman@linhes.org/mount/repository/linhes_pkgbuild into testing
Diffstat (limited to 'abs/core/runit-scripts/runitscripts/services/xymon-client/run')
-rw-r--r-- | abs/core/runit-scripts/runitscripts/services/xymon-client/run | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/abs/core/runit-scripts/runitscripts/services/xymon-client/run b/abs/core/runit-scripts/runitscripts/services/xymon-client/run new file mode 100644 index 0000000..a454c6b --- /dev/null +++ b/abs/core/runit-scripts/runitscripts/services/xymon-client/run @@ -0,0 +1,60 @@ +#!/bin/sh +export TERM=linux +. /etc/rc.conf +. /etc/rc.d/functions +stat_runit "Starting xymon client" + + + +# Default settings for this client +MACHINEDOTS="`uname -n`" # This systems hostname +SERVEROSTYPE="`uname -s | tr '[ABCDEFGHIJKLMNOPQRSTUVWXYZ/]' '[abcdefghijklmnopqrstuvwxyz_]'`" # This systems operating system in lowercase +XYMONOSSCRIPT="xymonclient-$SERVEROSTYPE.sh" + +# Command-line mods for the defaults +while test "$1" != "" +do + case "$1" in + --hostname=*) + MACHINEDOTS="`echo $1 | sed -e 's/--hostname=//'`" + ;; + --os=*) + SERVEROSTYPE="`echo $1 | sed -e 's/--os=//' | tr '[ABCDEFGHIJKLMNOPQRSTUVWXYZ/]' '[abcdefghijklmnopqrstuvwxyz_]'`" + ;; + --class=*) + CONFIGCLASS="`echo $1 | sed -e 's/--class=//' | tr '[ABCDEFGHIJKLMNOPQRSTUVWXYZ/]' '[abcdefghijklmnopqrstuvwxyz_]'`" + ;; + --help) + echo "Usage: $0 [--hostname=CLIENTNAME] [--os=rhel3|linux22] [--class=CLASSNAME] start|stop" + exit 0 + ;; + start) + CMD=$1 + ;; + stop) + CMD=$1 + ;; + restart) + CMD=$1 + ;; + status) + CMD=$1 + ;; + esac + + shift +done + +XYMONCLIENTHOME="`dirname $0`" +XYMONCLIENTHOME="/data/srv/xymon/client" +export MACHINEDOTS SERVEROSTYPE XYMONOSSCRIPT XYMONCLIENTHOME CONFIGCLASS + +MACHINE="`echo $MACHINEDOTS | sed -e 's/\./,/g'`" +export MACHINE + + +sudo -u nobody MACHINE=$MACHINE XYMONCLIENTHOME=$XYMONCLIENTHOME $XYMONCLIENTHOME/bin/xymonlaunch --config=$XYMONCLIENTHOME/etc/clientlaunch.cfg --log=$XYMONCLIENTHOME/logs/clientlaunch.log --pidfile=$XYMONCLIENTHOME/logs/clientlaunch.$MACHINEDOTS.pid --no-daemon + + + + |