Blackout host/service checks

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
scorit
Posts: 17
Joined: Wed Sep 25, 2019 3:06 am

Blackout host/service checks

Post by scorit »

Hi guys,

With VMs running only on business hours and being desactivated at night, we are looking for a solution to enable\disable active check “on-demand” using Nagios API call.
Disable check at host level has been validated throught API call.
But services checks are still active. It seems we need to specify every services name to be able to perform it.
Is there any solution to send API with only host parameter and disabling all services associated to this host ?

Thanks
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Blackout host/service checks

Post by gsmith »

Hi

Just wondering why you don't use the Check Period functionality to limit the hours that service checks are performed:
Image008.png

If you already have a bunch of services configured you can update the Check Period with the Bulk Modifications Tool
as shown in the attached mp4 file(zipped).

Let me know if this works for you or if you want to try it via the API.

Thanks!
You do not have the required permissions to view the files attached to this post.
scorit
Posts: 17
Joined: Wed Sep 25, 2019 3:06 am

Re: Blackout host/service checks

Post by scorit »

Thanks for the feedback.

Actually we have full automation through RunBook with cloud servers allocated/deallocated on the fly by dev team for cost saving purpose.

So VM can be shutdown without notice during 2 days and we want to avoid to have errors in the Nagios UI.

That's why we are looking how to enable\disable Nagios checks dynamically integrated into the Runbook.

What would be the option with API ?
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Blackout host/service checks

Post by gsmith »

Hi

Please go to Help, and under the API Docs on the left-hand menu select the System Reference link
and look at "POST system/scheduleddowntime" (screen cap below). That'll let you tell Nagios to
stop monitoring your hosts.
Image017.jpg
Thanks!
You do not have the required permissions to view the files attached to this post.
scorit
Posts: 17
Joined: Wed Sep 25, 2019 3:06 am

Re: Blackout host/service checks

Post by scorit »

If I am not mistaken the POST system/scheduleddowntime requires specific timeslot as mandatory parameter.
This is unknown as server can be offline/online upon need.
Is there a solution to call the API without specifying it ?
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Blackout host/service checks

Post by gsmith »

Hi,

Currently there is no API functionality to toggle monitoring on and off for a host/hostgroup. I can submit a Feature Request
to provide this functionality on your behalf. Please keep in mind that the decision to implement an enhancement is at
the discretion of our development team.

As a workaround you should be able to determine the current timestamp and use that with a date in the future (say 1/1/2025)
to turn off monitoring of the host/hostgroups of interest. You can set an id for the scheduled downtime when you issue the
command. You can then use that id to delete the scheduled downtime when you want to begin monitoring again.

Thanks
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: Blackout host/service checks

Post by gsmith »

Hi

Here is another thought:

Post to config/host or config/service with check_period=none for each of the hosts and services. The host and service
definitions would continue to live on and could be reactivated whenever needed by changing the check_period.


Thanks
Locked