Page 1 of 2

Automatic Schedule Downtime API or how?

Posted: Mon Oct 19, 2015 9:23 am
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!

Re: Automatic Schedule Downtime API or how?

Posted: Mon Oct 19, 2015 10:42 am
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

Re: Automatic Schedule Downtime API or how?

Posted: Mon Oct 19, 2015 11:03 am
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.

Re: Automatic Schedule Downtime API or how?

Posted: Mon Oct 19, 2015 11:14 am
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.

Re: Automatic Schedule Downtime API or how?

Posted: Mon Oct 19, 2015 1:03 pm
by agustin.roca
Great Guys! I will read all this and return feedback!

Cheers!

Re: Automatic Schedule Downtime API or how?

Posted: Mon Oct 19, 2015 1:42 pm
by jolson
Great - let us know. :)

Re: Automatic Schedule Downtime API or how?

Posted: Mon Oct 19, 2015 4:55 pm
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

Re: Automatic Schedule Downtime API or how?

Posted: Mon Oct 19, 2015 4:59 pm
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/

Re: Automatic Schedule Downtime API or how?

Posted: Mon Oct 19, 2015 7:56 pm
by Box293
I also have some examples here using the command pipe:
http://sites.box293.com/nagios/guides/t ... e-and-cgis

Re: Automatic Schedule Downtime API or how?

Posted: Thu Oct 22, 2015 9:07 am
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!