]> git.pld-linux.org Git - packages/nagios-nrpe.git/blame - nrpe.init
- adapter
[packages/nagios-nrpe.git] / nrpe.init
CommitLineData
6095acef
PZ
1#!/bin/sh
2#
3# Created 2000-01-03 by jaclu@grm.se
4# Rewritten for PLD 2004-06-02 by patrys@pld-linux.org
5#
90b87f0c 6# nrpe This shell script takes care of starting and stopping
7# nrpe.
6095acef 8#
90b87f0c 9# chkconfig: 2345 80 30
10# description: nrpe is a daemon for a remote nagios server, \
11# running nagios plugins on this host.
12# processname: nrpe
13# config: /usr/local/nagios/etc/nrpe.cfg
6095acef
PZ
14
15. /etc/rc.d/init.d/functions
16
17# Source networking configuration.
18. /etc/sysconfig/network
19
20# Check that networking is up.
21if is_yes "${NETWORKING}"; then
22 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
e10dc1bf 23 msg_network_down "nagios NRPE daemon"
6095acef
PZ
24 exit 1
25 fi
26else
27 exit 0
28fi
29
30case "$1" in
31 start)
32 if [ -f /var/lock/subsys/nrpe ]; then
e10dc1bf 33 msg_already_running "nagios NRPE daemon"
6095acef 34 else
e10dc1bf 35 msg_starting "nagios NRPE daemon"
6095acef 36 daemon nrpe -c /etc/nagios/nrpe.cfg -d
e10dc1bf 37 RETVAL=$?
38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nrpe
6095acef
PZ
39 fi
40 ;;
41 stop)
42 if [ -f /var/lock/subsys/nrpe ]; then
e10dc1bf 43 msg_stopping "nagios NRPE daemon"
6095acef
PZ
44 killproc nrpe
45 rm -f /var/lock/subsys/nrpe
46 else
e10dc1bf 47 msg_not_running "nagios NRPE daemon"
6095acef
PZ
48 fi
49 ;;
90b87f0c 50 restart|force-reload)
6095acef
PZ
51 $0 stop
52 $0 start
53 ;;
54 status)
55 status nrpe
90b87f0c 56 exit $?
6095acef
PZ
57 ;;
58 *)
90b87f0c 59 echo "Usage: nrpe {start|stop|restart|force-reload|status}"
60 exit 3
6095acef
PZ
61esac
62
63exit 0
This page took 0.063164 seconds and 4 git commands to generate.