Is there a way to use check_nt uptime to generate a warning/critical alert if the uptime is below a minute?
I'm trying to work out a way to monitor whether a server has rebooted or has rebooted itself.
check_nt Uptime
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: check_nt Uptime
Well, one way to check that could be through the windows event logs, that would be pretty sure-fire. Uptime? You should be able to define min and max warning and critical levels:
http://www.nsclient.org/nscp/wiki/Check ... heckUpTime
http://www.nsclient.org/nscp/wiki/Check ... heckUpTime
Re: check_nt Uptime
I use check_nt for the uptime check and tried adding "-c 1" to send me a critical alert when uptime is 1 minute but it doesn't work.
Could you tell me the correct syntax for the command please?
Also how simple is it to get nagios to look at the windows event log to detect a reboot - is there a plugin that can do this?
Could you tell me the correct syntax for the command please?
Also how simple is it to get nagios to look at the windows event log to detect a reboot - is there a plugin that can do this?
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: check_nt Uptime
Code: Select all
UPTIME =
Get the uptime of the machine.
-l <unit>
<unit> = seconds, minutes, hours, or days. (default: minutes)
Thresholds will use the unit specified above.
Here's a machine that has been up for 20 minutes. I tried with a critical of 19 and it generates an OK status (0).
Code: Select all
Command:
./check_nt -H win2008r2-01 -p 12489 -v UPTIME -c 19
Output:
System Uptime - 0 day(s) 0 hour(s) 20 minute(s) |uptime=20
Command:
echo $?
Output:
0
Code: Select all
Command:
./check_nt -H win2008r2-01 -p 12489 -v UPTIME -c 22
Output:
System Uptime - 0 day(s) 0 hour(s) 21 minute(s) |uptime=21
Command:
echo $?
Output:
2
NSClient++ can do this differently with different versions:szkoda wrote:Also how simple is it to get nagios to look at the windows event log to detect a reboot - is there a plugin that can do this?
0.3.9: https://mbrownnyc.wordpress.com/2011/08 ... -nagios-2/
0.4.x: http://www.medin.name/blog/2012/03/20/r ... -nsclient/
Although personally Nagios Log Server is a good solution as the logs are stored away from the original server and can be searched later. If someone clears the event logs on the original box it doesn't matter.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: check_nt Uptime
Thankyou, I've set it to 10 mins now and its working exactly as expected.
You can mark this as solved.
You can mark this as solved.