Module: check_mk
Branch: master
Commit: ca04c262b5a74b65950724aa66d2e3fc0325e3dd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ca04c262b5a74b…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Wed Aug 30 09:44:34 2017 +0200
5128 arbor_pravail: Now also checks for overrun drop rates of incoming queues
Change-Id: I4ede498259a2a6a3a470849e22946e5961decb9a
---
.werks/5128 | 10 ++++++++
checkman/arbor_pravail.drop_rate | 14 +++++++++++
checks/arbor.include | 53 ++++++++++++++++++++++++++++++++++++++++
checks/arbor_pravail | 12 ++++++++-
4 files changed, 88 insertions(+), 1 deletion(-)
diff --git a/.werks/5128 b/.werks/5128
new file mode 100644
index 0000000..eafbf60
--- /dev/null
+++ b/.werks/5128
@@ -0,0 +1,10 @@
+Title: arbor_pravail: Now also checks for overrun drop rates of incoming queues
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1504078675
+Class: feature
+
+
diff --git a/checkman/arbor_pravail.drop_rate b/checkman/arbor_pravail.drop_rate
new file mode 100644
index 0000000..aea46ca
--- /dev/null
+++ b/checkman/arbor_pravail.drop_rate
@@ -0,0 +1,14 @@
+title: Arbor Pravail Drop Rate
+agents: snmp
+catalog: hw/network/arbor
+license: GPL
+distribution: check_mk
+description:
+ Monitors the packet drop rate of incoming packets on Arbor Pravail
+ devices. This check can be configured using the "Generic rate"
+ rule and will turn warn/crit if the drop rate is below or above
+ the configured lower or upper limits, respectively.
+
+inventory:
+ Exactly one service is discovered.
+
diff --git a/checks/arbor.include b/checks/arbor.include
index 299c31f..26096f4 100644
--- a/checks/arbor.include
+++ b/checks/arbor.include
@@ -162,3 +162,56 @@ def check_arbor_host_fault(no_item, no_params, parsed):
#.
+# .--Drop Rate-----------------------------------------------------------.
+# | ____ ____ _ |
+# | | _ \ _ __ ___ _ __ | _ \ __ _| |_ ___ |
+# | | | | | '__/ _ \| '_ \ | |_) / _` | __/ _ \ |
+# | | |_| | | | (_) | |_) | | _ < (_| | || __/ |
+# | |____/|_| \___/| .__/ |_| \_\__,_|\__\___| |
+# | |_| |
+# '----------------------------------------------------------------------'
+
+def inventory_arbor_drop_rate(parsed):
+ if 'drop_rate' in parsed:
+ return [("Overrun", {})]
+
+
+def check_arbor_drop_rate(no_item, params, parsed):
+ drop_rate = int(parsed['drop_rate'])
+ infotext = '%s pps' % drop_rate
+
+ lower_status = 0
+ lower_levels = params.get('levels_lower')
+ if lower_levels:
+ warn, crit = lower_levels
+
+ if drop_rate <= crit:
+ lower_status, label = 2, '(!!)'
+ elif drop_rate <= warn:
+ lower_status, label = 1, '(!)'
+
+ if lower_status:
+ infotext += ' (warn/crit below %.1f/%.1f)%s' % (warn, crit, label)
+
+ upper_status = 0
+ upper_levels = params.get('levels')
+ if upper_levels:
+ warn, crit = upper_levels
+
+ if drop_rate >= crit:
+ upper_status, label = 2, '(!!)'
+ elif drop_rate >= warn:
+ upper_status, label = 1, '(!)'
+
+ if upper_status:
+ infotext += ' (warn/crit above %.1f/%.1f)%s' % (warn, crit, label)
+
+ perfdata = [("if_in_pkts", drop_rate, warn, crit)]
+ else:
+ perfdata = [("if_in_pkts", drop_rate)]
+
+ status = max(lower_status, upper_status)
+ yield status, infotext, perfdata
+
+
+#.
diff --git a/checks/arbor_pravail b/checks/arbor_pravail
index 97ede70..5052662 100644
--- a/checks/arbor_pravail
+++ b/checks/arbor_pravail
@@ -31,6 +31,7 @@
# .1.3.6.1.4.1.9694.1.6.2.6.0 8 --> PRAVAIL-MIB::deviceDiskUsage.0
# .1.3.6.1.4.1.9694.1.6.2.7.0 49 --> PRAVAIL-MIB::devicePhysicalMemoryUsage.0
# .1.3.6.1.4.1.9694.1.6.2.8.0 0 --> PRAVAIL-MIB::deviceSwapSpaceUsage.0
+# .1.3.6.1.4.1.9694.1.6.2.39.0 43 --> PRAVAIL-MIB::pravailOverrunDropRatePps.0
def parse_pravail(info):
@@ -40,7 +41,8 @@ def parse_pravail(info):
"cpu_loads" : valid[:3],
"disk" : valid[3],
"memory" : valid[4:6],
- "host_fault" : valid[6]
+ "host_fault" : valid[6],
+ "drop_rate" : valid[7],
}
@@ -59,6 +61,7 @@ check_info["arbor_pravail"] = {
"7.0", #
devicePhysicalMemoryUsage
"8.0", #
deviceSwapSpaceUsage
"1.0", #
pravailHostFault
+ "39.0",#
pravailOverrunDropRatePps
]
),
"snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.1.0").startswith("Pravail"),
@@ -92,3 +95,10 @@ check_info["arbor_pravail.host_fault"] = {
"service_description" : "Host Fault",
}
+check_info["arbor_pravail.drop_rate"] = {
+ "check_function" : check_arbor_drop_rate,
+ "inventory_function" : inventory_arbor_drop_rate,
+ "service_description" : "%s drop rate",
+ "has_perfdata" : True,
+ "group" : "generic_rate",
+}