clearer names for actions, and infer actions better
[monitor.git] / nagios / monitor-nagios.init
index 8223ee3..ab88aa7 100644 (file)
@@ -55,6 +55,15 @@ EOF
                htpasswd -b -c /etc/nagios/passwd nagiosadmin nagiospassword
        fi
 
+       # disable /etc/httpd/conf.d/nagios.conf restriction to only 127.0.0.1
+       if ( grep -q -E "^service_check_timeout=60" /etc/nagios/nagios.cfg ) ; then
+        # NOTE: PCU checks can take several minutes due to timeouts and internal delays
+               sed -i -e 's/service_check_timeout=.*/service_check_timeout=150/g' /etc/nagios/nagios.cfg 
+        # NOTE: All 'action' commands are in the notification category.
+        #       Complex actions such as 'repair.py' may take several minutes.
+               sed -i -e 's/notification_timeout=.*/notification_timeout=240/g' /etc/nagios/nagios.cfg 
+       fi
+
        # disable /etc/httpd/conf.d/nagios.conf restriction to only 127.0.0.1
        if ( grep -q -E "^   deny from all" /etc/httpd/conf.d/nagios.conf ) ; then
                sed -i -e 's/   deny from all/   #allow from all/g' /etc/httpd/conf.d/nagios.conf 
@@ -71,8 +80,8 @@ EOF
        fi
 
 
-       if ! ( grep -q "cfg_file=/etc/nagios/objects/plc.cfg" /etc/nagios/nagios.cfg) ; then
-               echo "cfg_file=/etc/nagios/objects/plc.cfg" >> /etc/nagios/nagios.cfg
+       if ! ( grep -q "cfg_file=/etc/nagios/objects/plcnodes.cfg" /etc/nagios/nagios.cfg ) ; then
+               echo "cfg_file=/etc/nagios/objects/plcnodes.cfg" >> /etc/nagios/nagios.cfg
                echo "cfg_file=/etc/nagios/objects/plcusers.cfg" >> /etc/nagios/nagios.cfg
        fi