16
Apr/0715
Apr/0715
Linux Downtime Script 0.3 (Perl)
Hi together,
it was for a long time on my TODO-list to update the nagios_downtime.pl which I created in beginning of ’06. Some month ago Andurin made a small update and saved it as version 0.2 to the original destination of the script. Now I worked on the script for several hours to add some features:
- Added SSL support (for HTTPS Crypt::SSLeay is needed)
- Added date format selection via new config value $nagiosDateFormat
- Added some basic response handling of response code and content
Hope these new features will be helpful for anyody out there? Here now the script in version 0.3a:
Update: The Nagios downtime scripts are now placed at the nagios_downtime project page on NagiosForge.
Have fun using this script. Please report ideas, problems or bugs. Some ways to submit them: here via comment, via mail or via post in German Nagios Forum.







22:04 on May 22nd, 2007
Hello!
Thanks for the script, it works great for our servers (a mix of Fedora Core 1 and 4, running nagios 2.0b3) after a minor modification:
The script sends the date as “mm-dd-yyyy hh:mm:ss” for the us version, and the command script doesn’t like the nonnumerical characters, causing the submitted time to be the max 32bit int (4294967295), so nothing is ever scheduled.
Replacing the “-” and ” ” characters with their hex (%) equivalents in the dates (“-” = “%2F” and ” ” = “%20″) makes this work:
Thanks!
…Chris
07:22 on May 24th, 2007
Thanks Chris, i’ll add this to the next version.
Lars
12:49 on December 14th, 2007
Hi, do you know of a script that can connect to the web interface to determine the status of a host/service? I’m looking for something similar to what you’ve written, and simply returns Nagios-style exit codes.
Thanks in advance.
13:08 on December 14th, 2007
Which language do you need? For what do you want to use the script?
If you use the NDO database you could get the state directly from the DB.
17:19 on January 4th, 2008
It can be in any language, but preferably in Perl. I require this script as I’ll be doing environmental monitoring in Nagios. This will then allow certain machines to determine if certain temperature checks have exceeded a fixed threshold by logging onto the Nagios web interface (via a script that I’m asking for), and if so, shutdown a number of machines and do other operations.
14:37 on January 17th, 2008
Thank you very much for this! I’ve been looking for something like this to schedule downtimes without having to log into the web interface. Much obliged.
12:33 on August 11th, 2008
hi..i have 1 query i wish to check ping status of server to client machines,right now i m checking every machine by seperatly pinging…i need a script that ping all the machines and will give automatic status the machine is in network or not……
12:34 on August 11th, 2008
hi..u r script is very nice…u r rocking…in linux…..
12:36 on August 11th, 2008
thanks………..chrisssssssssss
14:36 on March 12th, 2009
Where can I get the script?
21:15 on March 12th, 2009
You can get the current version from subversion at nagiosforge: https://www.nagiosforge.org/gf/project/nagios_downtime/scmsvn/?action=browse&path=%2Fperl%2Ftrunk%2F
01:50 on April 24th, 2009
Will the script work with Nagios version 3.0.5? I tried it out and keep getting “HTTP Response code 4xx says “client error” (401)”
07:20 on September 16th, 2010
I getting the same error and I’ve found out that in the nagios.cfg file, the date_format was set to iso8601 and the nagios_downtime script was using “us”. I updated the script, and but still didn’t work.
Nagios version: 3.2
./nagios_downtime -m add -t 2010-05-15 00:05:00 -S nagiosserver -p /nagios/cgi-bin -u testuser -P ****** -H hostname