maybe chmod 0755 './init.d/net.lo'
maybe chmod 0755 './init.d/netmount'
maybe chmod 0755 './init.d/network'
-maybe chown nagios './init.d/nrpe'
-maybe chgrp nagios './init.d/nrpe'
-maybe chmod 0750 './init.d/nrpe'
+maybe chmod 0755 './init.d/nrpe'
maybe chmod 0755 './init.d/nscd'
maybe chmod 0755 './init.d/ntp-client'
maybe chmod 0755 './init.d/ntpd'
#!/sbin/runscript
-opts="${opts} reload"
+extra_started_commands="reload"
+
+command="/usr/bin/nrpe"
+command_args="-c /etc/nagios/nrpe.cfg --daemon"
+pidfile="${pidfile:-/var/run/nrpe/nrpe.pid}"
+start_stop_daemon_args="--user nagios --group nagios"
depend() {
need net
}
-start() {
- ebegin "Starting nrpe"
- start-stop-daemon --start --quiet --name nrpe \
- --startas /usr/bin/nrpe \
- -c nagios:nagios \
- -- -c /etc/nagios/nrpe.cfg \
- --daemon
- eend $? "Failed to Start nrpe"
-}
-
-stop() {
- ebegin "Stopping nrpe"
- start-stop-daemon --stop --quiet -n nrpe
- eend $? "Failed to Stop nrpe"
+start_pre() {
+ checkpath -d -m 0750 -o nagios:nagios /var/run/nrpe
}
reload() {
ebegin "Reloading nrpe"
- kill -HUP `pgrep nrpe | head -1`
+ kill -HUP $(head -n1 ${pidfile})
eend $? "Failed to reload nrpe"
}
-
-restart() {
- ebegin "Restarting nrpe"
- svc_stop
- svc_start
- eend $? "Failed to Restart nrpe"
-}
# ALLOWED HOST ADDRESSES
# This is an optional comma-delimited list of IP address or hostnames
-# that are allowed to talk to the NRPE daemon.
+# that are allowed to talk to the NRPE daemon. Network addresses with a bit mask
+# (i.e. 192.168.1.0/24) are also supported. Hostname wildcards are not currently
+# supported.
#
# Note: The daemon only does rudimentary checking of the client's IP
# address. I would highly recommend adding entries in your /etc/hosts.allow