Page 1 of 1

Blackout/Maintenance automation

Posted: Tue Mar 08, 2016 1:43 pm
by Sundar
Client wants blackout/maintenance enhancement features like the ones mentioned below actually automated

1) Bulk upload/Multiple hosts
2) Blackout using cluster name
3) Blackout using service group
etc.,

We are looking to get some custom script created to meet these requirements. We could see this may be achieved via couple of options (do we have other options?)

i) curl -d "cmd_typ=23&cmd_mod=2&host=[THE-HOST]&service=[THE-SERVICE]&btnSubmit=Commit" "http://[NAGIOS-SERVER]/nagios/cgi-bin/cmd.cgi"

ii) Using external commands - http://old.nagios.org/developerinfo/ext ... mand_id=16

However, we would like to know how exactly these are different & which is the best way to schedule blackout for multiple hosts & services via commandline, that can be run from a remote host. Please advise on how to approach a feasible solution via scripting. Is there any existing script that can be customized?

Rgds,

Re: Blackout/Maintenance automation

Posted: Tue Mar 08, 2016 4:11 pm
by tmcdonald
Option 1 will definitely work in an automated fashion, you'll just need to provide the glue that will run the script against the hosts you need. Option 2 is basically the same thing as option 1, just instead of using a URL it uses a direct write to the command file and is usually done on the Nagios machine itself instead of remotely. Otherwise the two have the same effect.

Re: Blackout/Maintenance automation

Posted: Tue Mar 08, 2016 4:17 pm
by rkennedy
1. Are you talking about adding new hosts? We have an enterprise feature available, and that has bulk modifications allowed.

2. When you say cluster name, what are you referring to?

3. I believe you'll also need a ticket or authentication if you're using core.
i) you're going through the core interface (would need basic auth)
ii) you're using XI (I'm guessing your using the API?) can you provide the whole link? (this would use a ticket=)

I believe both will accomplish the same thing. We do have a bulk schedule downtime as well, but it's not through the CLI.