packages: nagios-ocpd/ocpd.init - create fifos - check send_nsca in config ...

glen glen at pld-linux.org
Mon Oct 12 17:23:16 CEST 2009


Author: glen                         Date: Mon Oct 12 15:23:16 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:
- create fifos
- check send_nsca in config test

---- Files affected:
packages/nagios-ocpd:
   ocpd.init (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: packages/nagios-ocpd/ocpd.init
diff -u packages/nagios-ocpd/ocpd.init:1.4 packages/nagios-ocpd/ocpd.init:1.5
--- packages/nagios-ocpd/ocpd.init:1.4	Mon Oct 12 15:05:03 2009
+++ packages/nagios-ocpd/ocpd.init	Mon Oct 12 17:23:11 2009
@@ -114,6 +114,11 @@
 		ret=1
 	fi
 
+	# the ocpd tests send_nsca, but it's result is lost due --fork
+	local nsca_host=$(awk '!/#/ { print }' $nsca_central_file)
+	echo >&2 "Checking $nsca..."
+	$nsca -H $nsca_host -c $nsca_cfg < /dev/null || ret=$?
+
 	return $ret
 }
 
@@ -160,6 +165,15 @@
 	local nsca_host=$(awk '!/#/ { print }' $nsca_central_file)
 	local hostfifo=$(awk -F= '/^host_perfdata_file=/{print $2}' $nagios_cfg)
 	local servicefifo=$(awk -F= '/^service_perfdata_file=/{print $2}' $nagios_cfg)
+
+	if [ ! -p "$hostfifo" ]; then
+		mkfifo -m 600 "$hostfifo"
+		chown nagios:nagios "$hostfifo"
+	fi
+	if [ ! -p "$servicefifo" ]; then
+		mkfifo -m 600 "$servicefifo"
+		chown nagios:nagios "$servicefifo"
+	fi
 
 	# XXX daemon() can't do --user and --fork without start-stop-daemon
 	export RC_LOGGING=no
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/nagios-ocpd/ocpd.init?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list