larsmichelsen / nagios_downtime Goto Github PK
View Code? Open in Web Editor NEWScript based downtime scheduling for Nagios / Icinga
License: GNU General Public License v2.0
Script based downtime scheduling for Nagios / Icinga
License: GNU General Public License v2.0
Its me again :)
I cannot say my english is excellent, but i had to learn trough my failure that the value of $nagiosDateFormat has a 1:1 relation to date_format in nagios.cfg, because i did not understand "same like set" as "has to be set same".
If they differ, the downtime scheduling fails with "Start or end time not valid" because nagios expects the date format specified in its config.
Maybe the line https://github.com/LaMi-/nagios_downtime/blob/master/nagios_downtime#L108 should read:
# Nagios date format (has to be set to the same value what "date_format" has in nagios.cfg)
my $nagiosDateFormat = "us";
Hi,
we are using check_mk and this script for our linux servers.
It works from check_mk's point of view - scheduled downtime is succesfully submitted, but i receive a general error message ("Some undefined error occured, turn debug mode on to view what happened."
The exit-code of the script is 1 - should be 0
Here's the debug output (anonymized):
Debug: HTTP-GET: http://monitoring.xxx.yyy:80/sysmonit/check_mk/view.py?output_format=json&_transid=-1&_do_confirm=yes&_do_actions=yes&&_username=Peter&_secret=paulandmary&view_name=hoststatus&host=server0815&_down_comment=Perl Downtime-Script (ID:1482415663)&_down_from_now=yes&_down_minutes=10
Debug: HTTP-Response: HINWEIS: Erfolgreich 1 Befehle gesendet.
[
[
"sitealias",
"host",
"host_parents",
"host_childs",
"host_addresses",
"alias",
"host_icons",
"host_state",
"host_plugin_output",
"host_pnpgraph",
"host_perf_data",
"host_in_downtime",
"host_in_notifper",
"num_services",
"num_services_ok",
"num_services_warn",
"num_services_crit",
"num_services_unknown",
"num_services_pending",
"host_attempt",
"host_notification_number",
"host_state_age",
"host_check_age",
"host_next_check",
"host_next_notification",
"host_last_notification",
"host_check_latency",
"host_check_duration",
"host_check_interval",
"host_notifper",
"host_contact_groups",
"host_contacts",
"host_group_memberlist",
"host_servicelevel",
"host_check_command",
"host_custom_vars",
"host_custom_notes"
],
[
"Local site sysmonit",
"server0815",
"",
"",
"1.2.3.4",
"server0815",
"menu",
"UP",
"Packet received via smart PING",
"",
"",
"nein",
"ja",
"20",
"20",
"0",
"0",
"0",
"0",
"1/3",
"0",
"2016-10-18 08:16:42",
"0 sec",
"in 38 sec",
"2016-10-18 08:16:42",
"-",
"0.000 sec",
"0.000 sec",
"60s/6s",
"24X7",
"all, Linux",
"Peter, Chantalle, Chayenne",
"SQL-Server, Linux",
"",
"check-mk-host-smart",
"",
""
]
]
This line
https://github.com/LaMi-/nagios_downtime/blob/master/nagios_downtime#L284
changed to
$p = Net::Ping->new("icmp");
works like a charm
OS Ubuntu Jaunty
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.