Implement two new external commands - one for hosts and one for services.
The scheduled forced host notification takes a host name and notification time and, when executed, sends a notification for the specified host "near" the desired notification time.
The scheduled forced service notification does the same but additionally takes in a service description and sends the notification for the service.
Force run scheduled event handler:
Implement two new external commands - one for hosts and one for services.
The scheduled forced host event handler takes a host name and notification time and, when executed, runs the event handler associated with the specified host "near" the desired notification time.
The scheduled forced service event handler does the same but additionally takes in a service description and runs the event handler associated with the service.
For internal reviewers, these are the actual feature requests: here and here.
IMPLEMENTATION
I found it most straightforward to implement each of these new external commands within existing core functionality with new options.
In order to both force and schedule the notifications and event handlers, I made the external commands schedule a forced check (either for a host or service, appropriately) which is a functionality that already exists.
However, these checks do not necessarily send a notification or run an event handler. To ensure the notification is sent or the event handler runs, I added two new check options: CHECK_OPTION_FORCE_NOTIFICATIONand CHECK_OPTION_FORCE_EVENT_HANDLER. When the check result is processed, it checks for these options and reacts accordingly.
TESTING PLAN
Run each of the four new external commands and verify that they work properly.
Please also check for code quality and any functional flaws in my prospective changes. There is a solid chance this is nowhere near to what was requested or is otherwise terrible. I learned a lot and that's what life is all about isn't it?
SUMMARY
For internal reviewers, these are the actual feature requests: here and here.
IMPLEMENTATION
CHECK_OPTION_FORCE_NOTIFICATION
andCHECK_OPTION_FORCE_EVENT_HANDLER
. When the check result is processed, it checks for these options and reacts accordingly.TESTING PLAN
Run each of the four new external commands and verify that they work properly.
SCHEDULE_FORCED_HOST_NOTIFICATION
SCHEDULE_FORCED_SVC_NOTIFICATION
SCHEDULE_FORCED_HOST_EVENT_HANDLER
SCHEDULE_FORCED_SVC_EVENT_HANDLER
These require some setup to test (including setting up event handlers). Here are some docs to help with that: [1] Example external command [2] List of external commands [3] Setting up event handlers
Please also check for code quality and any functional flaws in my prospective changes. There is a solid chance this is nowhere near to what was requested or is otherwise terrible. I learned a lot and that's what life is all about isn't it?