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
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
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
This fixes a typo in the nagios define-host plugin that
would append a domain name to the hostname
Change-Id: I62c3eca27d3ced28d2abe18d75bb6e71889c8ee3
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
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>