Answers to: How to schedule a nagios host downtime from commandline?http://linuxexchange.org/questions/2640/how-to-schedule-a-nagios-host-downtime-from-commandline<p>Hi,</p> <p>I have a problem..I want to schedule specific nagios severs downtime from the commandline by curl.How do I do that?</p> <p>Al though someone suggest me a script from serverfault site to do the service and host notification eneable and disable from commandline by curl.</p> <p>Looking for similar script which will trigger the scheduled downtime from the commandline instead going to the web interface.</p> <p>curl -d " some key value pair(hostname,servicename" url "username:passowrd"</p> <p>which will do the service/host notification on and off from the commandline. So I want use curl in this fashion to provide downtime for specific nagios server.</p> <p>Above script is not working for it because downtime option of nagios taked more parameter and I tried to infuse those in the script..but it didn't work out that way.We need provide starttime,endtime and comment value too.</p> <p>Plus I have tried curl's option called --form and --form-string with that script..not able to get through.</p> <p>The besic idea is instead of going to the Nagios web interface, we want to done this thing from the command line(we have succeded for service/host service and notification).</p> <p>TIA Bhaskar</p>enWed, 19 Oct 2011 09:18:26 -0400Answer by eddiezhttp://linuxexchange.org/questions/2640/how-to-schedule-a-nagios-host-downtime-from-commandline/2730<p>The Nagios group has a script that can be filled out with a reocurring sheduled downtime. You could use this instead on using teh GUI.</p>eddiezWed, 19 Oct 2011 09:18:26 -0400http://linuxexchange.org/questions/2640/how-to-schedule-a-nagios-host-downtime-from-commandline/2730Comment by Ron on Ron's answerhttp://linuxexchange.org/questions/2640/how-to-schedule-a-nagios-host-downtime-from-commandline#2645<p>"I want to schedule specific nagios severs downtime from the commandline" I get that. See my answers and also answer my question of "Why via curl?"</p>RonThu, 28 Jul 2011 18:58:56 -0400http://linuxexchange.org/questions/2640/how-to-schedule-a-nagios-host-downtime-from-commandline#2645Comment by unixbhaskar on Ron's answerhttp://linuxexchange.org/questions/2640/how-to-schedule-a-nagios-host-downtime-from-commandline#2643<p>I am afraid you grossly misunderstood my requirement..please re-read it and understand...don't worry about the passowrd details..I know what I am upto..just want the steps by the script I mentioned..if you have that well..otherwise...</p>unixbhaskarThu, 28 Jul 2011 02:19:20 -0400http://linuxexchange.org/questions/2640/how-to-schedule-a-nagios-host-downtime-from-commandline#2643Answer by Ronhttp://linuxexchange.org/questions/2640/how-to-schedule-a-nagios-host-downtime-from-commandline/2642<p>1) Password in scripts are dangerous and insecure. Same with sending them in clear-text format.</p> <p>2) You can schedule Nagios to check machines or not to check machines, thus the server can remain "on", but "down" / inactive.</p> <p>2a) Another option would be to stop the daemon itself from running by manually kill it or setting up a cron job to start and stop the daemon at a certain time(s) and day(s).</p> <p>2b) You can setup the PC itself to startup/shutdown on it's own instead.</p> <p>Why use curl?</p> <p>Why shutdown the process / computer vs. setting up scheduling?</p>RonWed, 27 Jul 2011 14:17:46 -0400http://linuxexchange.org/questions/2640/how-to-schedule-a-nagios-host-downtime-from-commandline/2642