[Nagiosplug-devel] check_log patches

Ethan Galstad egalstad at nagios.org
Wed Jun 2 17:20:35 CEST 2010


Here's a patch from Chris Pepper for the check_log plugin that may be of 
interest.  He asked that I forward the patch, as he isn't a subscriber.

Best regards,

- Ethan

-------- Original Message --------
Subject: [Fwd: check_log syntax change?]



--- check_log.sh	2008-11-30 16:23:18.000000000 -0500
+++ check_log.sh.pepper	2010-05-10 14:16:12.000000000 -0400
@@ -4,7 +4,7 @@
   # Written by Ethan Galstad (nagios at nagios.org)
   # Last Modified: 07-31-1999
   #
-# Usage: ./check_log <log_file> <old_log_file> <pattern>
+# Usage: ./check_log -F <log_file> -O <old_log_file> -q <pattern>
   #
   # Description:
   #
@@ -29,14 +29,14 @@
   #
   # If you use this plugin make sure to keep the following in mind:
   #
-#    1.  The "max_attempts" value for the service should be 1, as this
-#        will prevent Nagios from retrying the service check (the
+#    1.  The "max_check_attempts" value for the service should be 1, to
+#        prevent Nagios from retrying the service check (the
   #        next time the check is run it will not produce the same 
results).
   #
-#    2.  The "notify_recovery" value for the service should be 0, so that
-#        Nagios does not notify you of "recoveries" for the check.  Since
-#        pattern matches in the log file will only be reported once and not
-#        the next time, there will always be "recoveries" for the 
service, even
+#    2.  The "notification_options" value for the service must not 
include 'r',
+#        so Nagios does not notify you of "recoveries" for the check. Since
+#        pattern matches in the log file will only be reported once,
+#        the service would always appear to 'recover', even
   #        though recoveries really don't apply to this type of check.
   #
   #    3.  You *must* supply a different <old_file_log> for each 
service that
@@ -57,7 +57,7 @@

   # Paths to commands used in this script.  These
   # may have to be modified to match your system setup.
-# TV: removed PATH restriction. Need to think more about what this 
means overall
+# TV: removed PATH restriction. Need to think more about what this 
means overall.
   #PATH=""

   ECHO="/bin/echo"


-------- Original Message --------
Subject: check_log syntax change?
Date: Mon, 10 May 2010 12:21:16 -0400
From: Chris Pepper <pepper at cbio.mskcc.org>
To: Ethan Galstad <egalstad at nagios.com>

Ethan,

	I couldn't find a documentation web page for check_log, but the script 
contains this comment:

> # Usage: ./check_log <log_file> <old_log_file> <pattern>

	Unfortunately, that syntax doesn't actually work -- it requires -F -O & 
-q. The usage message needs an update, or (better) the program needs to 
understand the simpler syntax shown on the Usage line.

Regards,

Chris

> -bash-3.2$ /usr/local/nagios/libexec/check_log /var/log/messages messages.cache WARN
> Unknown argument: /var/log/messages
> Usage: check_log -F logfile -O oldlog -q query
> Usage: check_log --help
> Usage: check_log --version
> -bash-3.2$ /usr/local/nagios/libexec/check_log -F /var/log/messages -O messages.cache -q WARN
> Log check data initialized...
> -bash-3.2$

-- 
Chris Pepper:                <http://cbio.mskcc.org/>
                              <http://www.extrapepperoni.com/>


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: check_log.sh.pepper
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20100602/648b84b8/attachment.ksh>


More information about the Devel mailing list