Please note that LinuxExchange will be shutting down on December 31st, 2016. Visit this thread for additional information and to provide feedback.

Hi,

I have a problem..I want to schedule specific nagios severs downtime from the commandline by curl.How do I do that?

Al though someone suggest me a script from serverfault site to do the service and host notification eneable and disable from commandline by curl.

Looking for similar script which will trigger the scheduled downtime from the commandline instead going to the web interface.

curl -d " some key value pair(hostname,servicename" url "username:passowrd"

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.

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.

Plus I have tried curl's option called --form and --form-string with that script..not able to get through.

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).

TIA Bhaskar

asked 27 Jul '11, 05:41

unixbhaskar's gravatar image

unixbhaskar
73712
accept rate: 50%

edited 27 Jul '11, 10:33




1) Password in scripts are dangerous and insecure. Same with sending them in clear-text format.

2) You can schedule Nagios to check machines or not to check machines, thus the server can remain "on", but "down" / inactive.

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).

2b) You can setup the PC itself to startup/shutdown on it's own instead.

Why use curl?

Why shutdown the process / computer vs. setting up scheduling?

link

answered 27 Jul '11, 14:17

Ron's gravatar image

Ron ♦
9361718
accept rate: 13%

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...

(28 Jul '11, 02:19) unixbhaskar

"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?"

(28 Jul '11, 18:58) Ron ♦

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.

link

answered 19 Oct '11, 09:18

eddiez's gravatar image

eddiez
11
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×4

Asked: 27 Jul '11, 05:41

Seen: 4,144 times

Last updated: 19 Oct '11, 09:18

powered by OSQA