nrpe & checkeventlog

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
robert.anderko
Posts: 33
Joined: Thu Apr 24, 2014 5:38 pm

nrpe & checkeventlog

Post by robert.anderko »

Hi guys,
i trying get errors from application log in Windows server. When i try:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H ru-aur-p-602 -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 "filter=generated > -1d AND level = 'error'"
i get:

Code: Select all

Test(error, 6005, success)[test, ], MSSQL$RU_AUR_P_602(error, 6005, success)[test, ], MSSQL$RU_AUR_P_607(error, 6005, success)[test, ], eventlog: 3 > critical|'eventlog'=3;1;1
but with command:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H ru-aur-p-602 -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 "filter=generated > -1d AND source='MSSQL$RU_AUR_P_607'"
i get

Code: Select all

Eventlog check ok|'eventlog'=0;1;1
Any idea how can i get errors for logsource MSSQL$RU_AUR_P_602 ? and with another check only for MSSQL$RU_AUR_P_607 ?
thx for help
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: nrpe & checkeventlog

Post by ssax »

Try it with this:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H ru-aur-p-602 -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 'filter=generated > -1d AND source=\'MSSQL$RU_AUR_P_607\''
And this:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H ru-aur-p-602 -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 'filter=generated > -1d AND source=\'MSSQL\$RU_AUR_P_607\''
Or this:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H ru-aur-p-602 -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 "filter=generated > -1d AND source='MSSQL\$RU_AUR_P_607'"

Let us know the results.


Thank you
robert.anderko
Posts: 33
Joined: Thu Apr 24, 2014 5:38 pm

Re: nrpe & checkeventlog

Post by robert.anderko »

Hi ssax,
last example seems work OK. thx for reply & for usefull help. This thread can be locked.
robert.anderko
Posts: 33
Joined: Thu Apr 24, 2014 5:38 pm

Re: nrpe & checkeventlog

Post by robert.anderko »

hi guys,
maybe, i have question - from bash, is all ok:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H host -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 "filter=generated > -5m AND source='MSSQL\$RU_AUR_P_601' AND lev
Eventlog check ok|'eventlog'=0;1;1
But from, GUI:

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_nrpe -H host -t 60 -c CheckEventLog -a file=application MaxWarn=1 MaxCrit=1 "filter=generated \> -5m AND source=\'MSSQL\\\$RU_AUR_P_601\' AND level = \'error\'"
OUTPUT: Parsing failed: generated \> -5m AND source=\'MSSQL\$RU_AUR_P_601\' AND level = \'error\'
any idea?
thx
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: nrpe & checkeventlog

Post by Box293 »

Due to some issues with how PHP escapes characters the "Test Check Command" does not work in these situations and should be ignored.

So for all further testing of this service you need to:

Make the changes to the service
Save the Service
Apply Configuration
Go back to the home screen and find the Service
When viewing the Service Status Details page click the Schedule a forced immediate check link

Just to re-iterate, for all further testing for this service DO NOT use the "Test Check Command" button, follow the steps above.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
robert.anderko
Posts: 33
Joined: Thu Apr 24, 2014 5:38 pm

Re: nrpe & checkeventlog

Post by robert.anderko »

Box,
was tested your "process" but results are:

Code: Select all

Parsing failed: $
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: nrpe & checkeventlog

Post by Box293 »

In your Service Definition you'll need MSSQL\$$RU_AUR_P_601

https://support.nagios.com/kb/article.php?id=168
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
robert.anderko
Posts: 33
Joined: Thu Apr 24, 2014 5:38 pm

Re: nrpe & checkeventlog

Post by robert.anderko »

Box239,
all works! thx for fast reply and for interesting manual.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: nrpe & checkeventlog

Post by Box293 »

Excellent, glad to help you get it working.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked