NagEventLog license

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: NagEventLog license

Post by tgfde »

Hello,

I'm getting the error below from the nsclient log on windows 2008 when running local command to monitor a windows event from the event log.

command:
./check_nrpe -H %HOST ADDRESS% -p 5666 -c checkEventLog -a file=system MaxWarn=1 MaxCrit=4 filter.eventID==35 filter.written==\<2d filter.severity==information filter.eventSource=Time-Service truncate=1022 filter=in filter=all descriptions

log:
2014-07-30 13:52:51: error:c:\source\nscp\branches\stable\modules\checkeventlog\eventlog_record.hpp:134: Could not extract DLL for eventsource: WinRM: SYSTEM\CurrentControlSet\Services\EventLog\system\WinRM.EventMessageFile -- Failed to get value: 2: The system cannot find the file specified.
2014-07-30 13:52:51: error:modules\NRPEListener\NRPEListener.cpp:325: NRPESocketException: To much data cant create return packet (truncate datat)


Thanks.
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: NagEventLog license

Post by tgfde »

Ok I got the following command to work. However, it tells me everything is ok even though I see the event in the event viewer. The event id below gets written to the event log when a windows service has entered a running state so I know there are a lot of them in the event log. But the command tells me everything is ok.

./check_nrpe -H IP ADDRESS -p 5666 -c CheckEventLog -a filter=new file="system" MaxWarn=10 MaxCrit=10 filter-written=\>2d filter-eventID=="7036" filter-eventType==information filter=in filter=all

Thanks.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: NagEventLog license

Post by sreinhardt »

Can you show us the event as seen in windows, s that we can compare them to your filter?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NagEventLog license

Post by lmiltchev »

Are you sure your syntax is correct? Did you follow the examples, posted here:

http://www.nsclient.org/nscp/wiki/Check ... #ideventid

It seems like you have "filter-", where you should have "filter=", you have "==", "\>"...
Be sure to check out our Knowledgebase for helpful articles and solutions!
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: NagEventLog license

Post by tgfde »

I got it working with the command from the link provided.
i just have to figure out how to check what's written in the event log in the last ten minutes only.

Thank you!
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: NagEventLog license

Post by sreinhardt »

You might try the scan-range flag as defined here: http://docs.nsclient.org/reference/Chec ... scan-range
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: NagEventLog license

Post by tgfde »

Ok. I got the command to work locally from the Nagios host. However, when I set everything up in the UI, the service check is sending me a critical notification for every entry in the event log (system) Please below.

Local

Code: Select all

./check_nrpe -H HOSTADRESS -p 5666 -c CheckEventLog -a file=system MaxWarn=1 MaxCrit=1 "filter=generated gt -5m AND source = 'srv' AND id IN ('2019')" truncate=800 unique descriptions "syntax=%severity%: %source%: %id%: %message% (%count%)"
Eventlog check ok|'eventlog'=0;1;1;
UI

Code: Select all

 $USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckEventLog -a file=$ARG1$ MaxWarn=$ARG2$ MaxCrit=$ARG3$ "filter=generated gt $ARG4$ AND source = '$ARG5$' AND id IN ('$ARG6$')" truncate=800 unique descriptions "syntax=%severity%: %source%: %id%: %message% (%count%)" 

Code: Select all

arg1 = system
arg2 = 1
arg3 = 1
arg4 = -5m
arg5 = 'srv'
arg6 = '2019'
Please advise on why it is sending a critical error other than the specified event id (2019).

Here's what I get from the UI...
informational: Service Control Manager: 7036: The Application Experience service entered the running state. (1), eventlog: 1 > critical

Thanks in advanced.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NagEventLog license

Post by scottwilkerson »

Earlier in this post
http://support.nagios.com/forum/viewtop ... 10#p107190

you were looking for events with an ID of 7036 and now that is what is reporting, are you sure you have applied the configuration since making the changes?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: NagEventLog license

Post by tgfde »

I deleted the previous command and added a new one today. I also applied the configuration so many times already.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NagEventLog license

Post by tmcdonald »

tgfde wrote: arg5 = 'srv'
arg6 = '2019'
Are you quoting the arguments both in the command definition and in the ARGn fields? If so, they are probably being double-quoted in the final command giving you something like:

Code: Select all

[...] AND source = ''srv'' AND id IN (''2019'')" truncate= [...]
which would normally cause a SQL error, but I don't like making assumptions.
Former Nagios employee
Locked