Module: check_mk
Branch: master
Commit: e3bc5966c57b8b0effe32905b318ba29630b0757
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e3bc5966c57b8b…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Fri Jun 24 11:31:21 2011 +0200
f5 checks: indentation fixes
---
checks/f5_bigip_cluster | 14 ++++++------
checks/f5_bigip_fans | 50 +++++++++++++++++++++++-----------------------
checks/f5_bigip_pool | 6 ++--
checks/f5_bigip_psu | 12 +++++-----
checks/f5_bigip_vserver | 14 ++++++------
5 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/checks/f5_bigip_cluster b/checks/f5_bigip_cluster
index e0ecb01..8f43ca2 100644
--- a/checks/f5_bigip_cluster
+++ b/checks/f5_bigip_cluster
@@ -26,7 +26,7 @@
# Agent / MIB output
-# see: 1.3.6.1.4.1.3375.2.1.1.1.1.6.0
+# see: 1.3.6.1.4.1.3375.2.1.1.1.1.6.0
# F5-BIGIP-SYSTEM-MIB::sysAttrConfigsyncState (STRING)
# "-1 - uninitialized or disabled config state"
@@ -48,13 +48,13 @@ def check_f5_bigip_cluster(item, _no_params, info):
statusid, statustxt = cfgsyncstate.split(" - ")
# Possible states:
- # -1 unconfigured, ok only if original status
+ # -1 unconfigured, ok only if original status
# otherwise this would mean something is heavily
broken?
# 0 in sync, ok
# 1/2 one system outdated, warn
# 3 both systems outdated, crit (config split brain)
-
- if statusid == "0":
+
+ if statusid == "0":
return (0, "OK - " + statustxt)
elif statusid == "-1":
return (2, "CRIT - " + statustxt)
@@ -64,15 +64,15 @@ def check_f5_bigip_cluster(item, _no_params, info):
return (2, "CRIT - " + statustxt)
else:
return (3, "UNKNOWN - unexpected Output from SNMP Agent")
-
-
+
+
snmp_info["f5_bigip_cluster"] = \
( ".1.3.6.1.4.1.3375.2.1.1.1.1", [
6, # sysAttrConfigsyncState
])
-check_info["f5_bigip_cluster"] = (check_f5_bigip_cluster, "Config Sync
status", 0, inventory_f5_bigip_cluster )
+check_info["f5_bigip_cluster"] = (check_f5_bigip_cluster, "Config Sync
status", 0, inventory_f5_bigip_cluster )
snmp_scan_functions["f5_bigip_cluster"] = \
diff --git a/checks/f5_bigip_fans b/checks/f5_bigip_fans
index d46dc94..210c649 100644
--- a/checks/f5_bigip_fans
+++ b/checks/f5_bigip_fans
@@ -38,7 +38,7 @@ def f5_bigip_fans_genitem(fanid):
fantype = "Processor"
elif fanid >=100:
fantype = "Chassis"
- else:
+ else:
fantype = "Unknown"
return ("%s %d" % (fantype, fanid))
@@ -46,42 +46,42 @@ def f5_bigip_fans_genitem(fanid):
def inventory_f5_bigip_fans(checkname, info):
inventory = []
for line in info:
- for fanentry in line:
- inventory.append((f5_bigip_fans_genitem(fanentry[0]), None))
-
+ for fanentry in line:
+ inventory.append((f5_bigip_fans_genitem(fanentry[0]), None))
+
return inventory
def check_f5_bigip_fans(item, _no_params, info):
for line in info:
- for fanentry in line:
- if f5_bigip_fans_genitem(fanentry[0]) == item:
- speed = int(fanentry[1])
- if "Chassis" in item:
- # the "normal" speed is around 10K RPM
- warn, crit = (7500, 2000)
- else:
- # F5's CPU Fans run around 6K RPM
- warn, crit = (4000, 1200)
- msgtxt = " - speed is %d rpm" % speed
- if speed > warn:
- return (0, "OK" + msgtxt)
- elif speed < crit:
- return (2, "CRITCAL" + msgtxt)
- elif speed < warn:
- return (1, "WARNING" + msgtxt)
- else:
- return (3, "UNKNOWN - could not detect speed")
-
+ for fanentry in line:
+ if f5_bigip_fans_genitem(fanentry[0]) == item:
+ speed = int(fanentry[1])
+ if "Chassis" in item:
+ # the "normal" speed is around 10K RPM
+ warn, crit = (7500, 2000)
+ else:
+ # F5's CPU Fans run around 6K RPM
+ warn, crit = (4000, 1200)
+ msgtxt = " - speed is %d rpm" % speed
+ if speed > warn:
+ return (0, "OK" + msgtxt)
+ elif speed < crit:
+ return (2, "CRITCAL" + msgtxt)
+ elif speed < warn:
+ return (1, "WARNING" + msgtxt)
+ else:
+ return (3, "UNKNOWN - could not detect speed")
+
return (3, "UNKNOWN - item not found in SNMP output")
-
+
snmp_info["f5_bigip_fans"] = \
[ (".1.3.6.1.4.1.3375.2.1.3.2.1.2.1", [ 1, 3 ]),
( ".1.3.6.1.4.1.3375.2.1.3.1.2.1", [ 1, 3 ]), ]
-check_info["f5_bigip_fans"] = (check_f5_bigip_fans, "FAN %s", 0,
inventory_f5_bigip_fans )
+check_info["f5_bigip_fans"] = (check_f5_bigip_fans, "FAN %s", 0,
inventory_f5_bigip_fans )
# Get ID and Speed from the CPU and chassis fan tables
diff --git a/checks/f5_bigip_pool b/checks/f5_bigip_pool
index 63ca11a..26f94ec 100644
--- a/checks/f5_bigip_pool
+++ b/checks/f5_bigip_pool
@@ -27,9 +27,9 @@
# Agent / MIB output
# see: 1.3.6.1.4.1.3375.2.2.5.1.2.1
-# F5-BIGIP-LOCAL-MIB::ltmPoolName. 8.80.111.111.108.asci_encoded_str = Pool_NMA
-# F5-BIGIP-LOCAL-MIB::ltmPoolMemberCnt. 8.80.111.111.108.95.78.77.65 = 2
-# F5-BIGIP-LOCAL-MIB::ltmPoolActiveMemberCnt. 8.80.111.111.108.95.78.77.65 = 0
+# F5-BIGIP-LOCAL-MIB::ltmPoolName. 8.80.111.111.108.asci_encoded_str =
Pool_NMA
+# F5-BIGIP-LOCAL-MIB::ltmPoolMemberCnt. 8.80.111.111.108.95.78.77.65 = 2
+# F5-BIGIP-LOCAL-MIB::ltmPoolActiveMemberCnt. 8.80.111.111.108.95.78.77.65 = 0
# warn, crit numbers of pool members
diff --git a/checks/f5_bigip_psu b/checks/f5_bigip_psu
index 73611e5..53b5500 100644
--- a/checks/f5_bigip_psu
+++ b/checks/f5_bigip_psu
@@ -26,7 +26,7 @@
# Agent / MIB output
-#SysChassisPowerSupplyEntry ::=
+#SysChassisPowerSupplyEntry ::=
# SEQUENCE {
# sysChassisPowerSupplyIndex INTEGER,
# sysChassisPowerSupplyStatus INTEGER
@@ -45,7 +45,7 @@ def inventory_f5_bigip_psu(checkname, info):
for line in info:
psu, state = line[0]
# inventorize the PSU unless it's in state 2 (notpresent)
- if state != "2":
+ if state != "2":
inventory.append([("%s" % psu), None])
return inventory
@@ -63,17 +63,17 @@ def check_f5_bigip_psu(item, _no_params, info):
return (1, "WARN - PSU state: notpresent!")
else:
return (3, "UNKNOWN - PSU state is unknown")
-
-
+
+
return (3, "UNKNOWN - item not found in SNMP output")
-
+
# Get ID and status from the SysChassisPowerSupplyTable
snmp_info["f5_bigip_psu"] = \
[ (".1.3.6.1.4.1.3375.2.1.3.2.2.2.1", [ 1, 2 ]), ]
-check_info["f5_bigip_psu"] = (check_f5_bigip_psu, "PSU %s", 1,
inventory_f5_bigip_psu )
+check_info["f5_bigip_psu"] = (check_f5_bigip_psu, "PSU %s", 0,
inventory_f5_bigip_psu )
# Check using the vendor mib Id and verify it's a loadbalancer
diff --git a/checks/f5_bigip_vserver b/checks/f5_bigip_vserver
index 43f3ea4..d10f63c 100644
--- a/checks/f5_bigip_vserver
+++ b/checks/f5_bigip_vserver
@@ -27,23 +27,23 @@
# Example output
# Name of a Virt. Server:
-# 1.3.6.1.4.1.3375.2.2.10.2.3.1.1.ascii_encoded_string. "VS_XX"
+# 1.3.6.1.4.1.3375.2.2.10.2.3.1.1.ascii_encoded_string. "VS_XX"
# Textual Status (only supported in F5 OS 9.3+
# 1.3.6.1.4.1.3375.2.2.10.1.2.1.25.5.12.34.56.78.90 "The virtual server is
available"
# Table with name and status
-# 1.3.6.1.4.1.3375.2.2.10.13.2.1. 1 .5.12.34.56.78.90 "VS_XX"
+# 1.3.6.1.4.1.3375.2.2.10.13.2.1. 1 .5.12.34.56.78.90 "VS_XX"
# 1.3.6.1.4.1.3375.2.2.10.13.2.1. 2 .5.12.34.56.78.90 1
def inventory_f5_bigip_vserver(checkname,info):
inventory = []
for line in info:
-# snmp info will return some empty lines here, filter them and
+# snmp info will return some empty lines here, filter them and
# only inventorize OK status.
if line[0] != "":
if int(line[1]) == 1:
inventory.append((line[0], None))
- return inventory
+ return inventory
def check_f5_bigip_vserver(item, _no_params, info):
@@ -54,7 +54,7 @@ def check_f5_bigip_vserver(item, _no_params, info):
if status == 0:
return (1, "WARN - Virtual Server is disabled")
elif status == 1:
- return (0, "OK - Virtual Server is up and available")
+ return (0, "OK - Virtual Server is up and available")
elif status == 2:
return (2, "CRIT - Virtual Server is currently not
available")
elif status == 3:
@@ -65,7 +65,7 @@ def check_f5_bigip_vserver(item, _no_params, info):
return (3, "UNKNOWN")
return (3, "UNKNOWN - Virtual Server %s not found in SNMP output" % item)
-
+
snmp_info["f5_bigip_vserver"] = \
( ".1.3.6.1.4.1.3375.2.2.10.1.2.1", [
@@ -75,7 +75,7 @@ snmp_info["f5_bigip_vserver"] = \
-check_info["f5_bigip_vserver"] = (check_f5_bigip_vserver, "Virtual Server
%s", 0, inventory_f5_bigip_vserver )
+check_info["f5_bigip_vserver"] = (check_f5_bigip_vserver, "Virtual Server
%s", 0, inventory_f5_bigip_vserver )
snmp_scan_functions["f5_bigip_vserver"] = \