From a365f42bd81936ede898ecffdf525f7b0346c6f9 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Thu, 7 Aug 2014 11:58:35 +0000 Subject: [PATCH] Catch another UNKNOWN condition for the fedmsg nagios checks. --- .../files/scripts/check_fedmsg_consumer_backlog.py | 4 ++++ .../files/scripts/check_fedmsg_consumer_exceptions.py | 4 ++++ .../files/scripts/check_fedmsg_producers_consumers.py | 4 ++++ 3 files changed, 12 insertions(+) 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 773aa2f57e..a70d49f41b 100644 --- a/roles/nagios_client/files/scripts/check_fedmsg_consumer_backlog.py +++ b/roles/nagios_client/files/scripts/check_fedmsg_consumer_backlog.py @@ -17,6 +17,10 @@ try: print "UNKNOWN - %s does not exist" % fname sys.exit(3) + if not os.access(fname, os.W_OK): + print "UNKNOWN - cannot write to %s" % fname + sys.exit(3) + connect_to = "ipc:///%s" % fname ctx = zmq.Context() s = ctx.socket(zmq.SUB) diff --git a/roles/nagios_client/files/scripts/check_fedmsg_consumer_exceptions.py b/roles/nagios_client/files/scripts/check_fedmsg_consumer_exceptions.py index 54c14638d0..7fa5f6f4e4 100644 --- a/roles/nagios_client/files/scripts/check_fedmsg_consumer_exceptions.py +++ b/roles/nagios_client/files/scripts/check_fedmsg_consumer_exceptions.py @@ -17,6 +17,10 @@ try: print "UNKNOWN - %s does not exist" % fname sys.exit(3) + if not os.access(fname, os.W_OK): + print "UNKNOWN - cannot write to %s" % fname + sys.exit(3) + connect_to = "ipc:///%s" % fname ctx = zmq.Context() s = ctx.socket(zmq.SUB) diff --git a/roles/nagios_client/files/scripts/check_fedmsg_producers_consumers.py b/roles/nagios_client/files/scripts/check_fedmsg_producers_consumers.py index e779c6d11d..f5c00ccd12 100644 --- a/roles/nagios_client/files/scripts/check_fedmsg_producers_consumers.py +++ b/roles/nagios_client/files/scripts/check_fedmsg_producers_consumers.py @@ -19,6 +19,10 @@ try: print "UNKNOWN - %s does not exist" % fname sys.exit(3) + if not os.access(fname, os.W_OK): + print "UNKNOWN - cannot write to %s" % fname + sys.exit(3) + connect_to = "ipc:///%s" % fname ctx = zmq.Context() s = ctx.socket(zmq.SUB)