Imported Upstream version 2.15
This commit is contained in:
62
init-script.in
Normal file
62
init-script.in
Normal file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Created 2000-01-03 by jaclu@grm.se
|
||||
#
|
||||
# nrpe This shell script takes care of starting and stopping
|
||||
# nrpe.
|
||||
#
|
||||
# chkconfig: 2345 80 30
|
||||
# description: nrpe is a daemon for a remote nagios server, \
|
||||
# running nagios plugins on this host.
|
||||
# processname: nrpe
|
||||
# config: /usr/local/nagios/etc/nrpe.cfg
|
||||
|
||||
|
||||
# Source function library
|
||||
if [ -f /etc/rc.d/init.d/functions ]; then
|
||||
. /etc/rc.d/init.d/functions
|
||||
elif [ -f /etc/init.d/functions ]; then
|
||||
. /etc/init.d/functions
|
||||
elif [ -f /etc/rc.d/functions ]; then
|
||||
. /etc/rc.d/functions
|
||||
fi
|
||||
|
||||
# Source networking configuration.
|
||||
. /etc/sysconfig/network
|
||||
|
||||
# Check that networking is up.
|
||||
[ ${NETWORKING} = "no" ] && exit 0
|
||||
|
||||
NrpeBin=@bindir@/nrpe
|
||||
NrpeCfg=@sysconfdir@/nrpe.cfg
|
||||
LockFile=/var/lock/subsys/nrpe
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
# Start daemons.
|
||||
echo -n "Starting nrpe: "
|
||||
daemon $NrpeBin -c $NrpeCfg -d
|
||||
echo
|
||||
touch $LockFile
|
||||
;;
|
||||
stop)
|
||||
# Stop daemons.
|
||||
echo -n "Shutting down nrpe: "
|
||||
killproc nrpe
|
||||
echo
|
||||
rm -f $LockFile
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
status)
|
||||
status nrpe
|
||||
;;
|
||||
*)
|
||||
echo "Usage: nrpe {start|stop|restart|status}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user