Page 1 of 2

Custom Reporting or Database

Posted: Tue Jun 16, 2015 8:17 am
by peter.zanetti
With the devices we monitor we have put them on power management putting them to sleep at night and waking them up in the morning. What I am trying to do is be able to verify that these devices are going to sleep. We can do this manually one by one in the GUI:
graph for device.PNG
Is there a place in the database where we can see the time the device actually stopped communicating? Is there a way to do this in the reporting tab?

Re: Custom Reporting or Database

Posted: Tue Jun 16, 2015 11:45 am
by jolson
Do these devices generate alerts when they are put to sleep? It might be an interesting use case for the 'event timeline' report.
2015-06-16 11_43_52-Nagios XI - Reports - Firefox Developer Edition.png
Let me know if that report could help at all - it may be too cluttered depending on your environment.

Re: Custom Reporting or Database

Posted: Tue Jun 16, 2015 12:15 pm
by peter.zanetti
I will look into it but our environment on that server is close to 3500 hosts.

Re: Custom Reporting or Database

Posted: Tue Jun 16, 2015 12:27 pm
by peter.zanetti
Yeah, I can't even get the page to load. Each device has 4 services that would send an alert to that report. Any other ideas?

Re: Custom Reporting or Database

Posted: Tue Jun 16, 2015 1:00 pm
by jolson
Am I correct in assuming that these devices are a combination of Windows hosts and Linux hosts? The easiest solution might be to monitor the event log for a 'sleep' message, and alert if one hasn't been generated in the last day or so.

Is that a solution that would work for you?

Re: Custom Reporting or Database

Posted: Tue Jun 16, 2015 1:01 pm
by peter.zanetti
On this box all of the host are windows desktops.

Re: Custom Reporting or Database

Posted: Tue Jun 16, 2015 2:23 pm
by jolson
In that case, are you using NSClient to monitor these boxes? If so, you could use a command like this to check for a 'sleep' event log in the past day:

Code: Select all

[root@localhost nagios]# /usr/local/nagios/libexec/check_nrpe -H 192.168.x.x -c check_eventlog -a scan-range=24h filter=id=42 ok=count=1 warn=count=0 crit=count=0
OK: Event log seems fine|'count'=1;0;0
As a test, I put my computer to sleep and generated the event you see displayed above. If the event is not present, check_eventlog returns the following:

Code: Select all

[root@localhost nagios]# /usr/local/nagios/libexec/check_nrpe -H 192.168.x.x -c check_eventlog -a scan-range=24h filter=id=42 ok=count=1 warn=count=0 crit=count=0
CRITICAL: No entries found|'count'=0;0;0
Event ID 42 is the sleep event - this should be generated whenever a Windows Server/workstation enters sleep mode.

Please test the above and let me know if it will work for you. Thanks!

Re: Custom Reporting or Database

Posted: Tue Jun 16, 2015 2:41 pm
by peter.zanetti
I tried that and I got the response

Code: Select all

CHECK_NRPE: Error - Could not complete SSL handshake.

Re: Custom Reporting or Database

Posted: Tue Jun 16, 2015 3:28 pm
by jolson
It's likely that you need to add the following to your NSClient configuration on the Windows box in question.

Code: Select all

[/settings/default]
allowed hosts = 192.168.x.x

[/settings/NRPE/server]
insecure = 1
You can also use certificate-based authentication: http://www.medin.name/blog/2012/12/02/s ... ntication/

Re: Custom Reporting or Database

Posted: Thu Jun 18, 2015 7:55 am
by peter.zanetti
What am I supposed to put instead of 192.168.x.x