[Nagiosplug-devel] patch for check_log.sh

Andreas Krennmair krennmair at webdynamite.com
Thu Nov 21 03:08:03 CET 2002


Hello!

We had to modify the check_log plugin to make it work on our Linux
systems. Has this module ever been tested?

Anyway, a patch (unified diff against check_log.sh from nagiosplug-1.3.0
beta 1) is attached to this mail.

Regards,
Andreas Krennmair
-- 
________________________________________

  Andreas Krennmair (Development)
  WebDynamite IT Solutions GmbH
  Landstraße 49, A-4020 Linz, Austria
  http://www.webdynamite.com/
  +43 / 732 / 777 810 - 0 (fixed)
  +43 / 732 / 777 810 - 50 (fax)
________________________________________
-------------- next part --------------
--- check_log	Thu Nov 21 11:09:31 2002
+++ nagios/nagiosplug-1.3-beta1/plugins-scripts/check_log.sh	Thu Feb 28 07:43:00 2002
@@ -62,8 +62,8 @@
 
 ECHO="/bin/echo"
 GREP="/bin/grep"
-DIFF="/usr/bin/diff"
-TAIL="/usr/bin/tail"
+DIFF="/bin/diff"
+TAIL="/bin/tail"
 CAT="/bin/cat"
 RM="/bin/rm"
 
@@ -183,12 +183,12 @@
 
 # The temporary file that the script should use while
 # processing the log file.
-if [ -x /bin/mktemp ]; then
-	tempdiff="`/bin/mktemp /tmp/check_log.XXXXXXXXXX`"
+if [-x /bin/mktemp]; then
+	tempdiff="/bin/mktemp /tmp/check_log.XXXXXXXXXX"
 else
-	tempdiff="`/bin/date '+%H%M%S'`"
-        /bin/touch $tempdiff
-	/bin/chmod 600 $tempdiff
+	tempdiff="/tmp/check_log.`/bin/date '+%H%M%S'`"
+  /bin/touch $tempdiff
+	chmod 600 $tempdiff
 fi
 
 $DIFF $logfile $oldlog > $tempdiff
@@ -209,4 +209,6 @@
 	$ECHO "($count) $lastentry"
 fi
 
-exit $exitstatus
+exit exitstatus
+
+


More information about the Devel mailing list