Module: check_mk
Branch: master
Commit: 514bd4e26b45b8dce6a4c510ad2224b89054e27c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=514bd4e26b45b8…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Sep 9 16:54:47 2014 +0200
bluecat_dns_queries: Added counters
---
checks/bluecat_dns_queries | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/checks/bluecat_dns_queries b/checks/bluecat_dns_queries
index 242b319..7bb1d9b 100644
--- a/checks/bluecat_dns_queries
+++ b/checks/bluecat_dns_queries
@@ -34,8 +34,18 @@ def inventory_bluecat_dns_queries(info):
def check_bluecat_dns_queries(item, _no_params, info):
value_names = [ 'Success', 'Referral', 'NXRSet',
'NXDomain', 'Recursion', 'Failure' ]
- for value, name in zip(info[0], value_names):
- yield 0, "%s: %s" % (name, value), [ ( name, value )]
+ wrapped = False
+ now = time.time()
+ for value, name in zip(map(int, info[0]), value_names):
+ try:
+ timedif, rate = get_counter("bluecat_dns_queries."+name, now,
value)
+ yield 0, "%s: %s (last %.0f sec)" % (name, rate, timedif), [ (
name, value )]
+ except MKCounterWrapped:
+ wrapped = True
+ if wrapped:
+ raise MKCounterWrapped(None, "")
+
+
check_info["bluecat_dns_queries"] = {
"check_function" : check_bluecat_dns_queries,