Commit Graph

6 Commits

Author SHA1 Message Date
Gage Hugo
19317b5c6c Update define-nagios-hosts.py error handling
Currently if list_nodes fails in the define-nagios-hosts.py
script, the entire script will fail with some unknown
error. This change updates the script to better catch
and report any exceptions that happen.

Change-Id: I0e33f47af8ad8f69f2f1e4a5b377d0e31d0c0819
2022-04-03 21:24:37 +00:00
MirgDenis
548c599498 Align Nagios plugins with Python3
This commit aligns Nagios plugins with Python3.
Since dict.iteritems() was removed in Python3 and substituted
with ditc.items() we have to change them in plugins.

Change-Id: I782f90a91e8dadd959c4d8537a80c44180c0b78d
2020-04-30 18:00:43 +03:00
dmyrhorodskyi
c78298328e Change condition in define-host plugin
This commit changes confdition in define-host plugin in order to
prevent failing with "KeyError: 'NODE_DOMAIN'" in case we do not
have such environment variable.

Change-Id: I030e3f01ca9d25f3946fd621635f422d3278f21e
2020-03-13 15:54:12 +02:00
Meg Heisler
7502ee6e47 Replace node_name with host_name in nagios plugin
This fixes a typo in the nagios define-host plugin that
would append a domain name to the hostname

Change-Id: I62c3eca27d3ced28d2abe18d75bb6e71889c8ee3
2020-03-12 15:25:35 -05:00
Meg Heisler
cec7ff6963 Append the domain name to the host name in Nagios dashboard
This adds logic to check if an environment variable has been
set for the domain name and appends it to the host name
if it has so that the full FQDN appears in Nagios dashboard.
If the the domain name has not been set just the host name is
given like previous behavior.

Change-Id: Id42edb073d4701ddb61f4957af7e5ac5f931dfbf
2020-03-10 10:05:55 -05:00
Steve Wilkerson
381737ee61 Nagios: Update plugin for defining hosts and host groups
This renames the check_update_prometheus_hosts plugin to be more
representative of what the current functionality does, which is
to simply define nagios hosts. This also updates the behavior of
the plugin to no longer force a reload of nagios via a hangup
signal when attempting to update the hosts file. The result is a
significant reduction in the logs output by the Nagios service,
which will better enable tracking history of service checks and
hosts.

Instead of this plugin being run as a recurring check, it can now
be run as an init container for the Nagios pod so Nagios has a
comprehensive list of its hosts and host groups before starting
the service

Change-Id: Ife2cdf2112db3798dbde73bafe436ef3c0c8a870
Signed-off-by: Steve Wilkerson <sw5822@att.com>
2019-06-28 11:03:02 -05:00