check_log via check_nrpe problem

Brandstaetter, Sigmund sigmund.brandstaetter at hp.com
Fri Nov 4 04:53:14 CET 2011


Hi Guys,

First of all, hello, since this is my first post to the list.

I hope some of you will be able to give me some input on my problem.

I have a Nagios Server to monitor some Hosts (Nagios 3.3.1) using NRPE and
SNMP Checks

I wanna check a logfile for eg. the string error.

The check works fine when I run it locally, meaning, after the check detects
the pattern, it creates an alert, then, on the next check, if no new pattern
was detected, it will return OK.

When I now run the check via nrpe from the nagios server, it will also
detect the pattern, but it will also come back with CRITICAL on each check
thereafter even if there have been no additional occurrences of it.

This is what the corresponding line in the nrpe.cfg on the remote host looks
like for this check:

command[check_messages]=/usr/local/nagios/libexec/check_log -F
/var/log/messages -O /tmp/messages -q "error"

Note that all other checks work fine, so nrpe works fine.


EG:

[root at xx libexec]# ./check_nrpe -H xxxxxx -c check_messages
(2) < error
[root at xx libexec]# ./check_nrpe -H xxxxxx -c check_messages
(2) < error
[root at xx libexec]# ./check_nrpe -H xxxxxx -c check_messages
(2) < error
[root at xx libexec]# ./check_nrpe -H xxxxxx -c check_messages
(2) < error
[root at xx libexec]# ./check_nrpe -H xxxxxx -c check_messages
(2) < error

But locally on the host, using the same check_log with the same parameters
that I have in my nrpe.cfg it works:

[root at xx libexec]# ./check_log -F /var/log/messages -O /tmp/messages -q
"error"
(13) < Nov  4 10:49:57 tuphlog1 nagios: SERVICE NOTIFICATION:
nagiosadmin;tuphweb2;LOG - Authentication
Errors;UNKNOWN;notify-service-by-email;Log check error: xxxx
[root at xx libexec]# ./check_log -F /var/log/messages -O /tmp/messages -q
"error"
Log check ok - 0 pattern matches found


Any Idea what could be the problem?

Cheers
Sigmund


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6218 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20111104/eb73ec32/attachment.bin>
-------------- next part --------------
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list