Module: check_mk
Branch: master
Commit: 46e0f8f02f5f6ee2a502c3d3f63318f8061aeff1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=46e0f8f02f5f6e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Aug 13 10:36:36 2011 +0200
ntp.time: handle case where ntpq has empty output
---
checks/ntp | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/checks/ntp b/checks/ntp
index 62708d1..b108b44 100644
--- a/checks/ntp
+++ b/checks/ntp
@@ -134,6 +134,10 @@ def check_ntp(item, params, info):
return (3, "UNKNOWN - peer not found")
def check_ntp_summary(item, params, info):
+ # No information at all? NTP daemon not running or timeout in ntpq -p
+ if len(info) == 0:
+ return (3, "UNKNOWN - no information from NTP: timeout in ntpq -p or NTP
daemon not running")
+
# We only are interested in our system peer or pulse per second source (pps)
for line in info:
if line[0] in [ "*", "o" ]: