3 # Created 2000-01-03 by jaclu@grm.se
4 # Rewritten for PLD 2004-06-02 by patrys@pld-linux.org
6 # nrpe This shell script takes care of starting and stopping
9 # chkconfig: 2345 80 30
10 # description: nrpe is a daemon for a remote nagios server, \
11 # running nagios plugins on this host.
13 # config: /etc/nagios/nrpe.cfg
15 . /etc/rc.d/init.d/functions
17 # Source networking configuration.
18 . /etc/sysconfig/network
20 # Check that networking is up.
21 if is_yes "${NETWORKING}"; then
22 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
23 msg_network_down "Nagios NRPE daemon"
30 pidfile=/var/run/nrpe/nrpe.pid
33 if [ -f /var/lock/subsys/nrpe ]; then
34 msg_already_running "Nagios NRPE daemon"
38 msg_starting "Nagios NRPE daemon"
39 daemon /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nrpe
45 if [ ! -f /var/lock/subsys/nrpe ]; then
46 msg_not_running "Nagios NRPE daemon"
50 msg_stopping "Nagios NRPE daemon"
51 killproc --pidfile $pidfile nrpe
52 rm -f /var/lock/subsys/nrpe
56 if [ ! -f /var/lock/subsys/nrpe ]; then
57 msg_not_running "Nagios NRPE daemon"
85 status --pidfile $pidfile nrpe
89 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"