From 1c0516c8310d2e6af3bbec9bffe6e3a8272acbd2 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Tue, 15 Aug 2023 14:25:56 -0700 Subject: [PATCH] nagios_client: adjust fedmsg monitoring Copy the fixes from exceptions monitoring to backlog. Fix the calls that were passing a trailing - which isn't needed anymore. Signed-off-by: Kevin Fenzi --- .../files/scripts/check_fedmsg_consumer_backlog.py | 8 +++++++- .../nagios_client/templates/check_fedmsg_consumers.cfg.j2 | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/roles/nagios_client/files/scripts/check_fedmsg_consumer_backlog.py b/roles/nagios_client/files/scripts/check_fedmsg_consumer_backlog.py index 54b6691732..b024bd25a1 100644 --- a/roles/nagios_client/files/scripts/check_fedmsg_consumer_backlog.py +++ b/roles/nagios_client/files/scripts/check_fedmsg_consumer_backlog.py @@ -11,7 +11,13 @@ try: check_consumer = sys.argv[2] backlog_warning = int(sys.argv[3]) backlog_critical = int(sys.argv[4]) - fname = '/var/run/fedmsg/monitoring-%s-3.socket' % service + if os.path.exists('/var/run/fedmsg/monitoring-%s-.socket' % service): + fname = '/var/run/fedmsg/monitoring-%s-.socket' % service + elif os.path.exists('/var/run/fedmsg/monitoring-%s-3.socket' % service): + fname = '/var/run/fedmsg/monitoring-%s-3.socket' % service + else: + print("UNKNOWN - socket file does not exists") + sys.exit(3) if not os.path.exists(fname): print("UNKNOWN - %s does not exist" % fname) diff --git a/roles/nagios_client/templates/check_fedmsg_consumers.cfg.j2 b/roles/nagios_client/templates/check_fedmsg_consumers.cfg.j2 index 4f5b59deb7..82efa65929 100644 --- a/roles/nagios_client/templates/check_fedmsg_consumers.cfg.j2 +++ b/roles/nagios_client/templates/check_fedmsg_consumers.cfg.j2 @@ -3,7 +3,7 @@ command[check_fedmsg_cp_busgateway_relay]={{libdir}}/nagios/plugins/check_fedmsg {% if (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int < 8) or (ansible_distribution_major_version|int < 30 and ansible_distribution == 'Fedora') %} command[check_fedmsg_cp_busgateway_gateway]={{libdir}}/nagios/plugins/check_fedmsg_producers_consumers.py fedmsg-gateway GatewayConsumer MonitoringProducer {% else %} -command[check_fedmsg_cp_busgateway_gateway]={{libdir}}/nagios/plugins/check_fedmsg_producers_consumers.py fedmsg-gateway- GatewayConsumer MonitoringProducer +command[check_fedmsg_cp_busgateway_gateway]={{libdir}}/nagios/plugins/check_fedmsg_producers_consumers.py fedmsg-gateway GatewayConsumer MonitoringProducer {% endif %} command[check_fedmsg_cp_anitya_relay]={{libdir}}/nagios/plugins/check_fedmsg_producers_consumers.py fedmsg-relay RelayConsumer MonitoringProducer command[check_fedmsg_cp_app]={{libdir}}/nagios/plugins/check_fedmsg_producers_consumers.py fedmsg-relay RelayConsumer MonitoringProducer @@ -19,7 +19,7 @@ command[check_fedmsg_cexceptions_busgateway_relay]={{libdir}}/nagios/plugins/che {% if (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int < 8) or (ansible_distribution_major_version|int < 30 and ansible_distribution == 'Fedora') %} command[check_fedmsg_cexceptions_busgateway_gateway]={{libdir}}/nagios/plugins/check_fedmsg_consumer_exceptions.py fedmsg-gateway GatewayConsumer 1 10 {% else %} -command[check_fedmsg_cexceptions_busgateway_gateway]={{libdir}}/nagios/plugins/check_fedmsg_consumer_exceptions.py fedmsg-gateway- GatewayConsumer 1 10 +command[check_fedmsg_cexceptions_busgateway_gateway]={{libdir}}/nagios/plugins/check_fedmsg_consumer_exceptions.py fedmsg-gateway GatewayConsumer 1 10 {% endif %} command[check_fedmsg_cexceptions_anitya_relay]={{libdir}}/nagios/plugins/check_fedmsg_consumer_exceptions.py fedmsg-relay RelayConsumer 1 10 command[check_fedmsg_cexceptions_app]={{libdir}}/nagios/plugins/check_fedmsg_consumer_exceptions.py fedmsg-relay RelayConsumer 1 10 @@ -35,7 +35,7 @@ command[check_fedmsg_cbacklog_busgateway_relay]={{libdir}}/nagios/plugins/check_ {% if (ansible_distribution == 'RedHat' and ansible_distribution_major_version|int < 8) or (ansible_distribution_major_version|int < 30 and ansible_distribution == 'Fedora') %} command[check_fedmsg_cbacklog_busgateway_gateway]={{libdir}}/nagios/plugins/check_fedmsg_consumer_backlog.py fedmsg-gateway GatewayConsumer 10 50 {% else %} -command[check_fedmsg_cbacklog_busgateway_gateway]={{libdir}}/nagios/plugins/check_fedmsg_consumer_backlog.py fedmsg-gateway- GatewayConsumer 10 50 +command[check_fedmsg_cbacklog_busgateway_gateway]={{libdir}}/nagios/plugins/check_fedmsg_consumer_backlog.py fedmsg-gateway GatewayConsumer 10 50 {% endif %} command[check_fedmsg_cbacklog_anitya_relay]={{libdir}}/nagios/plugins/check_fedmsg_consumer_backlog.py fedmsg-relay RelayConsumer 10 50 command[check_fedmsg_cbacklog_app]={{libdir}}/nagios/plugins/check_fedmsg_consumer_backlog.py fedmsg-relay RelayConsumer 10 50