From: Stephen Gran Date: Sun, 15 Jul 2012 16:31:57 +0000 (+0100) Subject: this is probably a hack X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-nagios.git;a=commitdiff_plain;h=b197df06a2f5cd6837cff067a9f3f2a3d533d2c7 this is probably a hack Signed-off-by: Stephen Gran --- diff --git a/dsa-nagios-checks/checks/dsa-check-statusfile b/dsa-nagios-checks/checks/dsa-check-statusfile index 6ca691d..4654731 100755 --- a/dsa-nagios-checks/checks/dsa-check-statusfile +++ b/dsa-nagios-checks/checks/dsa-check-statusfile @@ -74,8 +74,15 @@ if not returnvalue in NAGIOS_STATUS: print "UNKNOWN: %s has invalid return value: %s."%(statusfile, returnvalue) sys.exit(NAGIOS_STATUS['UNKNOWN']) +linecnt = 0 for line in status: print line, + linecnt += 1 + +if linecnt == 0: + print "Found no output. Something is probably wrong" + sys.exit(NAGIOS_STATUS['UNKNOWN']) + sys.exit(NAGIOS_STATUS[returnvalue]) # vim:set et: