check_log via check_nrpe problem

MAD mad at b-care.net
Fri Nov 4 08:32:52 CET 2011


Hi,

If you ran your tests with an other user than the one NRPE is using on 
your server, may be he can't overwrite your /tmp/messages file and 
trigger a CRITICAL state (I see in your tests you are logged in as root).

Marc-André

On 11/04/2011 04:53 AM, Brandstaetter, Sigmund wrote:
> 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
>
>
>
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
>
>
> _______________________________________________
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20111104/8a27fd93/attachment.html>
-------------- 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