Page 1 of 1

Schedule downtime for a host from a commandline/script

Posted: Fri Nov 30, 2012 10:34 am
by lois54
Hi all
I hope this is not an FAQ or something. I have looked but do not see this anywhere.
I would like to set a host to a "scheduled down time" state from a script. I am working on automating patching and often forget to do this step which can annoy my coworkers. Is there anyway to do this? I am writing my script in bash but I can also do perl or python. We are using Nagios version 3.0.3 currently. Thanks for your help.

Peace,
Lois
--
Lois Bennett, MSEE
Senior System Administrator
Channing Laboratory
Brigham & Women's Hospital
A Teaching Affiliate of
Harvard Medical School and
Harvard School of Public Health

Re: Schedule downtime for a host from a commandline/script

Posted: Sun Dec 02, 2012 5:39 pm
by jsmurphy
You can use whatever language you want, but here is an example in bash: http://old.nagios.org/developerinfo/ext ... and_id=119

Hopefully that helps :)

Re: Schedule downtime for a host from a commandline/script

Posted: Mon Dec 03, 2012 1:25 pm
by slansing
Jsmurphy has a great answer, and there are also other great examples such as this one:

http://exchange.nagios.org/directory/Ad ... er/details

And here is a link to the Nagios Exchange page on Scheduled Downtime:

http://exchange.nagios.org/directory/Ad ... d-Downtime

Re: Schedule downtime for a host from a commandline/script

Posted: Mon Dec 03, 2012 2:42 pm
by lois54
Thanks everyone. I am happy that this was so straight forward.

Peace,
Lois

Re: Schedule downtime for a host from a commandline/script

Posted: Mon Dec 03, 2012 5:07 pm
by slansing
Glad to see we had a solution for you, thanks for confirming!