I'm looking for a way to schedule server reboots using Nagios. I asked this question during a training/demo session and was told it's possible using event handlers, but how to accomplish that escapes me. The goal is to reboot all of our Windows servers every weekend at a specific time during our maintenance window. We are using Nagios XI 2014R2.7, NSClient++ 0.4.3.143, and NRPE checks.
I have been playing around with this setup with mixed results so far. I loosely followed the guide here.
- - Batch file located in the C:\Program Files\NSClient++\scripts directory containing the reboot command
- Entry in nsclient.ini /settings/external scripts/scripts section: reboot_machine=scripts\reboot_machine.bat
- Service assigned to host running command: $USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ where ARG1 = "reboot_machine"
- Custom check period set up on the service for a duration of 1 minute at the time I want the reboot to happen
Is there a better way to do this? I would hope so. It would be awesome if in the same service setup we can have a reboot event triggered at a specific time, and have the last reboot time monitored and reported back.
Thanks!
Mike