Source

woocode / sa-auto / sh / nagios-nrpe.sh

Full commit
#!/bin/sh

PIDFILE=/tmp/nrpe.pid
NrpeBin=/apps/svr/nagios/bin/nrpe
NrpeCfg=/apps/svr/nagios/etc/nrpe.cfg
LockFile=/apps/svr/nagios/nrpe.lock
export LD_LIBRARY_PATH=/apps/lib/openssl/lib

stop() { 
    echo -n "Shutting down nrpe: "
    test -f $PIDFILE && kill -TERM $(cat $PIDFILE)
    rm -f $PIDFILE
}

start(){
    echo -n "Starting nrpe: "
    test -f $PIDFILE || $NrpeBin -c $NrpeCfg -d 
}


case "$1" in
  start)
        start
	;;
  stop)
        stop
	;;
  restart)
	stop
	start
	;;
  status)
        echo "Not implement yet"
	;;
  *)
	echo "Usage: nrpe {start|stop|restart|status}"
	exit 1
esac

exit 0