Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Added "start" argument to the Nagios module so that one can specify w… #55652
…hen downtime should start. It defaults to "now", which preserves existing behavior of the module.
A "start" attribute has been added to the scheduling functions so that one can provide a start time for scheduled downtime. Like Nagios itself, the time is specified in time_t format. If no time is specified, it defaults to the current time, which is how the module always behaved before.
The specific reason I needed this feature is at my organization we do updates on a monthly cycle. We use Ansible to run updates on Linux servers and schedule their reboots during the official maintenance window. Scheduling downtime in Nagios is difficult without the ability to specify a start time that coincides with the reboot. I had been working on a role that would have scheduled outages directly without using the Nagios module, but extending the module to support a start time seemed a much cleaner approach. I hope others find this change useful too.
The Nagios module had no way to specify when downtime was supposed to start, only a duration. Now it supports both, with the start time optional (it defaults to the current time).