3 # nagios Host/service/network monitoring daemon
6 # description: Host/service/network monitoring daemon which uses snort as NIDS
9 # Source function library
10 . /etc/rc.d/init.d/functions
13 . /etc/sysconfig/network
16 [ -f /etc/sysconfig/nagios ] && . /etc/sysconfig/nagios
18 # Check that networking is up.
19 if is_yes "${NETWORKING}"; then
20 if [ ! -f /var/lock/subsys/network ]; then
21 # nls "ERROR: Networking is down. %s can't be run." <service>
22 msg_network_down nagios
29 # See how we were called.
32 # Check if the service is already running?
33 if [ ! -f /var/lock/subsys/nagios ]; then
35 # remove stale cmd pipe (or nagios won't start if it exists)
36 rm -f /var/log/nagios/rw/nagios.cmd
37 daemon nagios -d /etc/nagios/nagios.cfg </dev/null
39 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nagios
40 chgrp http /var/lib/nagios/rw/nagios.cmd
42 msg_already_running nagios
48 if [ -f /var/lock/subsys/nagios ]; then
51 rm -f /var/lock/subsys/nagios > /dev/null 2>&1
53 msg_not_running nagios
66 msg_usage "$0 {start|stop|restart|status}"