Page 1 of 1
nrpe & checkeventlog
Posted: Thu Jun 23, 2016 6:03 am
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
Re: nrpe & checkeventlog
Posted: Thu Jun 23, 2016 1:01 pm
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
Re: nrpe & checkeventlog
Posted: Fri Jun 24, 2016 9:34 pm
by robert.anderko
Hi ssax,
last example seems work OK. thx for reply & for usefull help. This thread can be locked.
Re: nrpe & checkeventlog
Posted: Mon Jun 27, 2016 1:44 am
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
Re: nrpe & checkeventlog
Posted: Mon Jun 27, 2016 1:48 am
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.
Re: nrpe & checkeventlog
Posted: Mon Jun 27, 2016 2:37 am
by robert.anderko
Box,
was tested your "process" but results are:
Re: nrpe & checkeventlog
Posted: Mon Jun 27, 2016 2:39 am
by Box293
In your Service Definition you'll need
MSSQL\$$RU_AUR_P_601
https://support.nagios.com/kb/article.php?id=168
Re: nrpe & checkeventlog
Posted: Mon Jun 27, 2016 2:44 am
by robert.anderko
Box239,
all works! thx for fast reply and for interesting manual.
Re: nrpe & checkeventlog
Posted: Mon Jun 27, 2016 2:45 am
by Box293
Excellent, glad to help you get it working.