Home Directory Plugins Operating Systems Windows Check for unexpected reboot

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Check for unexpected reboot

Rating
0 votes
Favoured:
1
Current Version
0.1
Last Release Date
2012-09-18
Compatible With
  • Nagios 1.x
  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI
  • Nagios Fusion
License
GPL
Hits
54395
Files:
FileDescription
check_unexpected_reboot.cmdcheck_unexpected_reboot.cmd

Help Support Ethan Galstad's New Project:

Help Support Ethan

A Message From The Founder...

As the founder of Nagios, I'm asking for your help in a cause that's dear to my heart.

I'm launching a new project to help better the world by providing the information, ideas, and inspiration that I believe can improve the lives of people everywhere.

I know you're busy managing networks, but I would appreciate it if you would consider liking my Facebook page and showing your support for the content and messages I produce by sharing them with your friends and family.

You can learn more about my project by visiting ethangalstad.me/nagios. Thank you for your time. I wish you all the best in your endeavors, whatever they may be.

- Ethan

check_unexpected_reboot.cmd is a Windows cmd script that checks for a reboot after a crash or power outage of a Windows machine.
check_unexpected_reboot.cmd is a Windows cmd script that checks for a reboot after a crash or power outage of a Windows machine.
It uses wevtutil.exe (Windows Vista, 2008 and up only) to read eventlog details from the command line.
It compares the dates between a normal boot and an unexpected reboot. So the alarm will always go off after an unexpected reboot and until the system has had a normal reboot. This is in order for you to do a nice chkdsk c: at boottime, which Windows refuses to do automatically.
Once a normal reboot is newer than an unexpected or the unexpected event is cleared, the alarm will go away. Use this plugin with Nsclient++ and add the following to the section [External Scripts] in NSC.ini:
check_unexpected_reboot=cmd /c scriptscheck_unexpected_reboot.cmd
Use check_nrpe to remotely check from your Nagios server

NOTE: to make the test go green again you would normally have to perform a clean reboot.
You can bypass this by sending an event with ID 13 to the eventlog.
E.g.: 'eventcreate /L system /T INFORMATION /SO "Nagios_confirm" /ID 13 /D "Unexpected reboot confirmed"'