CheckEventLog Genrated Time displayed Wrongly

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dhineshkumar
Posts: 22
Joined: Wed Jul 22, 2015 8:32 am

CheckEventLog Genrated Time displayed Wrongly

Post by dhineshkumar »

Hi.,

I am trying Event ID monitoring through NSclient CheckEventLog, with the below ouptut syntax.

syntax=Time:%generated%, Event ID:%id%, Source=%source%, Type=%level%, Message=%message%"

But the time Format is dispalyed like Time: 2w 3d 05:26. I tried with %generated% also, it is also giving the same result.

Please suggest a option to print the date details in DD/MM/YYYY TIME format.


Thanks
Dhinesh Kumar S.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: CheckEventLog Genrated Time displayed Wrongly

Post by mcapra »

Can you share which version of NSClient++ is being used on the remote machine? A lot of this answer depends on the version of NSClient++.

You may need to set a time filter for the EventLog module and configure the detail syntax in the NSClient++ configuration:
https://docs.nsclient.org/reference/win ... l%20syntax
Former Nagios employee
https://www.mcapra.com/
dhineshkumar
Posts: 22
Joined: Wed Jul 22, 2015 8:32 am

Re: CheckEventLog Genrated Time displayed Wrongly

Post by dhineshkumar »

Hi

The nsclient version is 0.4.419.

I am running the checks through nrpe with the below command.

check_nrpe -H $HOSTADDRESS$ -p 5666 -t 60 -c CheckEventLog -a file=Application file=System file=Security debug=true MaxCrit=1 "filter=id = <event id> AND generated > -1h" unique descriptions "syntax=Time:%generated%, Event ID:%id%, Source=%source%, Type=%level%, Message=%message%

Thanks.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: CheckEventLog Genrated Time displayed Wrongly

Post by mcapra »

descriptions actually appears to be deprecated as of 0.4.2:
http://docs.nsclient.org/0.4.2/referenc ... scriptions

That aside, i'm not seeing anything in the NSClient++ documentation that clearly spells out how to change the date formatting. The documentation indicates that the previous directive I mentioned is the ticket, but I can't find any example of this.
Former Nagios employee
https://www.mcapra.com/
Locked