Automatic Schedule Downtime API or how?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
agustin.roca
Posts: 39
Joined: Tue Apr 28, 2015 10:28 am

Automatic Schedule Downtime API or how?

Post by agustin.roca »

Hi guys,

Is there a way to automate the scheduled Downtime for hosts/services via API or other way? This would be great.

Thanks!
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Automatic Schedule Downtime API or how?

Post by jolson »

Yes, this is definitely do-able. The video is a little old, but it shows you what you need to do:

https://www.youtube.com/watch?v=v1cgoMGaEbs
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Automatic Schedule Downtime API or how?

Post by BanditBBS »

There is yet another way if you don't need it on a recurring schedule. We use the method I am going to mention during an auto-clone process we have.

Look here http://old.nagios.org/developerinfo/ext ... ndlist.php

Then search for downtime and you can see all the different commands to use when scheduling downtimes. When our auto-clone process kicks off, in its script is to use the two commands: SCHEDULE_HOST_DOWNTIME and SCHEDULE_HOST_SVC_DOWNTIME to schedule a downtime for a host and all services on that host while it is being cloned.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Automatic Schedule Downtime API or how?

Post by WillemDH »

Or you can use this script I made for Nagios Reactor => http://outsideit.net/naf-schedule-downtime/ You can use it in multiple ways and even target hostgroups, host or a service.
Nagios XI 5.8.1
https://outsideit.net
agustin.roca
Posts: 39
Joined: Tue Apr 28, 2015 10:28 am

Re: Automatic Schedule Downtime API or how?

Post by agustin.roca »

Great Guys! I will read all this and return feedback!

Cheers!
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Automatic Schedule Downtime API or how?

Post by jolson »

Great - let us know. :)
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
agustin.roca
Posts: 39
Joined: Tue Apr 28, 2015 10:28 am

Re: Automatic Schedule Downtime API or how?

Post by agustin.roca »

I thought Nagios Reactor was a component in nagios xi. So i need to run another server or instance with reactor? I will try to read about Reactor but have no idea about it.. Sounds cool!

Cheers
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Automatic Schedule Downtime API or how?

Post by jolson »

Yup - it's a different product that we provide for free. It's quite powerful, as WillemDH has demonstrated plenty. ;)

https://www.nagios.com/products/nagios-reactor/
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Automatic Schedule Downtime API or how?

Post by Box293 »

I also have some examples here using the command pipe:
http://sites.box293.com/nagios/guides/t ... e-and-cgis
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
agustin.roca
Posts: 39
Joined: Tue Apr 28, 2015 10:28 am

Re: Automatic Schedule Downtime API or how?

Post by agustin.roca »

Yeps.. i read about Reactor.. looks good, but still couldnt see or read much so i couldnt quite understand what id does in full. The videos are not very clear.

I did it using the commands as Bandit suggested. Quite easy approach.

Thanks a lot guys!

Will try to look again about Rector as it sounds promissing. any link that is technical and explains usefulness and use cases is appreciated.

Cheers!
Locked