Module: check_mk
Branch: master
Commit: ce3267d1b304acfc785c69d837bd379b52d5a27f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ce3267d1b304ac…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri May 29 10:27:00 2015 +0200
Reduced number of SNMP OIDs needed for running all scan functions a bit
---
checks/canon_pages | 13 +++++++------
checks/carel_uniflair_cooling | 20 ++++++++++----------
checks/cisco_mem | 3 ++-
checks/fortigate_memory | 3 ++-
checks/netapp_cluster | 2 +-
checks/netapp_cpu | 3 ++-
checks/netapp_fcpio | 3 ++-
checks/netapp_vfiler | 2 +-
checks/netapp_volumes | 2 +-
9 files changed, 28 insertions(+), 23 deletions(-)
diff --git a/checks/canon_pages b/checks/canon_pages
index 1783cd0..71f927f 100644
--- a/checks/canon_pages
+++ b/checks/canon_pages
@@ -58,11 +58,12 @@ def check_canon_pages(item, _no_params, info):
return (3, 'Item not found in SNMP data')
check_info["canon_pages"] = {
- 'check_function': check_canon_pages,
- 'inventory_function': inventory_canon_pages,
- 'service_description': 'Pages %s',
- 'has_perfdata': True,
- 'snmp_info': ( ".1.3.6.1.4.1.1602.1.11.1.3.1.4", [
OID_END, "" ]),
- 'snmp_scan_function': lambda oid:
oid(".1.3.6.1.4.1.1602.1.1.1.1.0") != None
+ 'check_function' : check_canon_pages,
+ 'inventory_function' : inventory_canon_pages,
+ 'service_description' : 'Pages %s',
+ 'has_perfdata' : True,
+ 'snmp_info' : ( ".1.3.6.1.4.1.1602.1.11.1.3.1.4", [
OID_END, "" ]),
+ 'snmp_scan_function' : lambda oid: "canon" in
oid(".1.3.6.1.2.1.1.1.0").lower() \
+ and
oid(".1.3.6.1.4.1.1602.1.1.1.1.0") != None
}
diff --git a/checks/carel_uniflair_cooling b/checks/carel_uniflair_cooling
index e6c5ec5..c51c74d 100644
--- a/checks/carel_uniflair_cooling
+++ b/checks/carel_uniflair_cooling
@@ -26,15 +26,15 @@
# snmp_scan_function
-#.1.3.6.1.2.1.1.4.0 = STRING: x.name(a)green-cooling.de < green-cooling match
-#.1.3.6.1.2.1.1.5.0 = STRING: pCOWeb < pcoweb match
-#.1.3.6.1.4.1.9839.1 < exists
+# .1.3.6.1.2.1.1.4.0 = STRING: x.name(a)green-cooling.de < green-cooling match
+# .1.3.6.1.2.1.1.5.0 = STRING: pCOWeb < pcoweb match
+# .1.3.6.1.4.1.9839.1 < exists
# snmp_info
-#.1.3.6.1.4.1.9839.2.1.1.31.0 = INTEGER: 0 < Waterloss
-#.1.3.6.1.4.1.9839.2.1.1.51.0 = INTEGER: 1 < Global
-#.1.3.6.1.4.1.9839.2.1.1.67.0 = INTEGER: 0 < Unit in Emergeny operation
-#.1.3.6.1.4.1.9839.2.1.2.6.0 = INTEGER: 246 < Humidifier: Relative Humidity
+# .1.3.6.1.4.1.9839.2.1.1.31.0 = INTEGER: 0 < Waterloss
+# .1.3.6.1.4.1.9839.2.1.1.51.0 = INTEGER: 1 < Global
+# .1.3.6.1.4.1.9839.2.1.1.67.0 = INTEGER: 0 < Unit in Emergeny operation
+# .1.3.6.1.4.1.9839.2.1.2.6.0 = INTEGER: 246 < Humidifier: Relative Humidity
def inventory_carel_uniflair_cooling(info):
@@ -70,9 +70,9 @@ check_info["carel_uniflair_cooling"] = {
"inventory_function" : inventory_carel_uniflair_cooling,
"service_description" : "Carel uniflair cooling",
"has_perfdata" : True,
- "snmp_scan_function" : lambda oid: "green-cooling" in
oid(".1.3.6.1.2.1.1.4.0").lower() \
- and "pcoweb" in
oid(".1.3.6.1.2.1.1.5.0").lower() \
- and oid(".1.3.6.1.4.1.9839.1.2.0"),
+ "snmp_scan_function" : lambda oid: ("pCO" in
oid(".1.3.6.1.2.1.1.1.0")
+ or "Linux" in
oid(".1.3.6.1.2.1.1.1.0")) \
+ and oid(".1.3.6.1.4.1.9839.1.2.0"),
"snmp_info" : (".1.3.6.1.4.1.9839.2.1", [
"1.31.0", # Waterloss
"1.51.0", # Global
diff --git a/checks/cisco_mem b/checks/cisco_mem
index 082e648..77adfd2 100644
--- a/checks/cisco_mem
+++ b/checks/cisco_mem
@@ -75,6 +75,7 @@ check_info["cisco_mem"] = {
"service_description" : "Mem used %s",
"has_perfdata" : True,
"group" : "cisco_mem",
- "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.4.1.9.9.48.1.1.1.6.1"),
+ "snmp_scan_function" : lambda oid: "cisco" in
oid(".1.3.6.1.2.1.1.1.0").lower() \
+ and
oid(".1.3.6.1.4.1.9.9.48.1.1.1.6.1"),
"snmp_info" : ( ".1.3.6.1.4.1.9.9.48.1.1.1", [
"2", "5", "6", "7" ]),
}
diff --git a/checks/fortigate_memory b/checks/fortigate_memory
index 94ce3c5..027e6d3 100644
--- a/checks/fortigate_memory
+++ b/checks/fortigate_memory
@@ -63,7 +63,8 @@ check_info["fortigate_memory"] = {
"service_description" : "Memory usage",
"has_perfdata" : True,
"group" : "memory",
- "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.4.1.12356.1.9.0"),
+ "snmp_scan_function" : lambda oid: "fortigate" in
oid(".1.3.6.1.2.1.1.1.0").lower() \
+ and oid(".1.3.6.1.4.1.12356.1.9.0"),
"snmp_info" : ( ".1.3.6.1.4.1.12356.1", [ 9 ]),
}
diff --git a/checks/netapp_cluster b/checks/netapp_cluster
index dd7ba9e..3b107fa 100644
--- a/checks/netapp_cluster
+++ b/checks/netapp_cluster
@@ -104,6 +104,6 @@ check_info["netapp_cluster"] = {
]),
'snmp_scan_function': \
# Run inventory only on Data Ontap OS with cluster enabled
- lambda oid: "netapp release" in
oid(".1.3.6.1.2.1.1.1.0").lower() or \
+ lambda oid: "netapp release" in
oid(".1.3.6.1.2.1.1.1.0").lower() and \
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.789"),
}
diff --git a/checks/netapp_cpu b/checks/netapp_cpu
index cf9f475..e7e0ef4 100644
--- a/checks/netapp_cpu
+++ b/checks/netapp_cpu
@@ -44,7 +44,8 @@ check_info["netapp_cpu"] = {
"service_description" : "CPU utilization",
"has_perfdata" : True,
"group" : "cpu_utilization",
- "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.4.1.789.1.2.1.3.0"),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.1.0").startswith('NetApp Release') \
+ and
oid(".1.3.6.1.4.1.789.1.2.1.3.0"),
"snmp_info" : ( ".1.3.6.1.4.1.789.1.2.1", [ 3 ]),
}
diff --git a/checks/netapp_fcpio b/checks/netapp_fcpio
index 61aafda..7707b88 100644
--- a/checks/netapp_fcpio
+++ b/checks/netapp_fcpio
@@ -68,7 +68,8 @@ check_info["netapp_fcpio"] = {
"service_description" : "FCP I/O",
"has_perfdata" : True,
"group" : "netapp_fcportio",
- "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.4.1.789.1.17.20.0"),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.1.0").startswith('NetApp Release') \
+ and
oid(".1.3.6.1.4.1.789.1.17.20.0"),
"snmp_info" : ( ".1.3.6.1.4.1.789.1.17", [ 20, 21 ]),
}
diff --git a/checks/netapp_vfiler b/checks/netapp_vfiler
index a15673b..b19b684 100644
--- a/checks/netapp_vfiler
+++ b/checks/netapp_vfiler
@@ -69,6 +69,6 @@ check_info["netapp_vfiler"] = {
# get the vfName and vfState from the vfEntry table
'snmp_info': ('.1.3.6.1.4.1.789.1.16.3.1',
['2', '9']),
'snmp_scan_function': \
- lambda oid: "netapp release" in
oid(".1.3.6.1.2.1.1.1.0").lower() or \
+ lambda oid: "netapp release" in
oid(".1.3.6.1.2.1.1.1.0").lower() and \
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.789"),
}
diff --git a/checks/netapp_volumes b/checks/netapp_volumes
index 05e5fe4..e079ca9 100644
--- a/checks/netapp_volumes
+++ b/checks/netapp_volumes
@@ -125,6 +125,6 @@ check_info["netapp_volumes"] = {
'6', # volStatus
]),
'snmp_scan_function': \
- lambda oid: oid(".1.3.6.1.2.1.1.1.0").startswith('NetApp
Release') or \
+ lambda oid: oid(".1.3.6.1.2.1.1.1.0").startswith('NetApp
Release') and \
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.789"),
}