Module: check_mk
Branch: master
Commit: 642d1815fd37488804551c95682c4a0f74ea3ffc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=642d1815fd3748…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Sep 7 12:26:17 2011 +0200
Added 4 new checks dell_powerconnect_* by Chris Bowlby
---
ChangeLog | 3 +++
checks/dell_powerconnect_cpu | 2 +-
checks/dell_powerconnect_fans | 12 ++++++------
checks/dell_powerconnect_psu | 14 +++++++-------
checks/dell_powerconnect_temp | 36 ++++++++++++++++++------------------
5 files changed, 35 insertions(+), 32 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 32e1fb8..bd39ef2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
1.1.11i4
+ Checks & Agents:
+ * Added 4 new checks dell_powerconnect_* by Chris Bowlby
+
Multisite:
* FIX: WATO filtered status GUIs did not update the title after changing
the title of the file/folder in WATO
diff --git a/checks/dell_powerconnect_cpu b/checks/dell_powerconnect_cpu
index e3e34ed..bb8cb9f 100644
--- a/checks/dell_powerconnect_cpu
+++ b/checks/dell_powerconnect_cpu
@@ -66,7 +66,7 @@ def check_dell_powerconnect_cpu(item, params, info):
[('load', '%d%%' % cpu_load, params[0], params[1], 0,
100),
('loadavg 60s', '%d%%' % int(oneminuteperc),
params[0], params[1], 0, 100),
('loadavg 5m', '%d%%' % int(fiveminutesperc),
params[0], params[1], 0, 100),
- ])
+ ])
return (3, "UNKNOWN - Invalid information in snmp data")
diff --git a/checks/dell_powerconnect_fans b/checks/dell_powerconnect_fans
index 11c8f32..f448330 100644
--- a/checks/dell_powerconnect_fans
+++ b/checks/dell_powerconnect_fans
@@ -42,7 +42,7 @@
# Status codes:
# 1 => normal,
# 2 => warning,
-# 3 => critical,
+# 3 => critical,
# 4 => shutdown,
# 5 => notPresent,
# 6 => notFunctioning
@@ -56,21 +56,21 @@ dell_powerconnect_fans_state_performance_map = { '1': 1,
'2': 0, '3': 0, '4': 0,
def inventory_dell_powerconnect_fans(checkname, info):
inventory = []
for device_id, name, state in info:
- if dell_powerconnect_fans_status_map[state] != 'notPresent':
- inventory.append((name, None))
+ if dell_powerconnect_fans_status_map[state] != 'notPresent':
+ inventory.append((name, None))
return inventory
# The check for the states and details of each fan
def check_dell_powerconnect_fans(item, _not_used, info):
for device_id, name, state in info:
- if name == item:
+ if name == item:
dell_powerconnect_status = dell_powerconnect_fans_status_map[state]
status = dell_powerconnect_fans_status2nagios_map[dell_powerconnect_status]
return (status, '%s - Condition of FAN "%s" is %s' %
(nagios_state_names[status], name, dell_powerconnect_status),
[
- ("state", dell_powerconnect_fans_state_performance_map[state],
"", 0, 0, 1),
- ])
+ ("state",
dell_powerconnect_fans_state_performance_map[state], "", 0, 0, 1),
+ ])
return (3, "UNKNOWN - item not found in snmp data")
diff --git a/checks/dell_powerconnect_psu b/checks/dell_powerconnect_psu
index b2c5b30..ab1167a 100644
--- a/checks/dell_powerconnect_psu
+++ b/checks/dell_powerconnect_psu
@@ -41,7 +41,7 @@
# Status codes:
# 1 => normal,
# 2 => warning,
-# 3 => critical,
+# 3 => critical,
# 4 => shutdown,
# 5 => notPresent,
# 6 => notFunctioning
@@ -63,21 +63,21 @@ dell_powerconnect_psu_state_performance_map = { '1': 1,
'2': 0, '3': 0, '4': 0,
def inventory_dell_powerconnect_psu(checkname, info):
inventory = []
for device_id, name, state, supply in info:
- if dell_powerconnect_psu_status_map[state] != 'notPresent':
- inventory.append((name, None))
+ if dell_powerconnect_psu_status_map[state] != 'notPresent':
+ inventory.append((name, None))
return inventory
# Check of the states of each PS unit.
def check_dell_powerconnect_psu(item, _not_used, info):
for device_id, name, state, supply in info:
- if name == item:
+ if name == item:
dell_powerconnect_status = dell_powerconnect_psu_status_map[state]
status = dell_powerconnect_psu_status2nagios_map[dell_powerconnect_status]
-
+
return (status, '%s - Condition of PSU "%s" is %s, with source
%s' %
(nagios_state_names[status], name, dell_powerconnect_status,
dell_powerconnect_psu_supply_map[supply]), [
- ("state", dell_powerconnect_psu_state_performance_map[state],
"", 0, 0, 1),
- ])
+ ("state",
dell_powerconnect_psu_state_performance_map[state], "", 0, 0, 1),
+ ])
return (3, "UNKNOWN - item not found in snmp data")
diff --git a/checks/dell_powerconnect_temp b/checks/dell_powerconnect_temp
index a59c4a6..9ba66a3 100644
--- a/checks/dell_powerconnect_temp
+++ b/checks/dell_powerconnect_temp
@@ -37,7 +37,7 @@
# Status codes:
# 1 => ok,
# 2 => unavailable,
-# 3 => nonoperational,
+# 3 => nonoperational,
# GENERAL MAPS:
dell_powerconnect_temp_status_map = { '1': 'ok', '2':
'unavailable', '3': 'nonoperational' }
@@ -51,30 +51,30 @@ dell_powerconnect_temp_default_values = (35, 40)
def inventory_dell_powerconnect_temp(checkname, info):
inventory = []
for temp, state in info:
- # use default variable as parameter. Note the quotes!
- inventory.append((None, "dell_powerconnect_temp_default_values"))
+ # use default variable as parameter. Note the quotes!
+ inventory.append((None, "dell_powerconnect_temp_default_values"))
return inventory
# Execute a check against each sensor.
def check_dell_powerconnect_temp(item, params, info):
warn, crit = params
for temp, state in info:
- status = 0
- dell_powerconnect_status = dell_powerconnect_temp_status_map[state]
+ status = 0
+ dell_powerconnect_status = dell_powerconnect_temp_status_map[state]
- if int(temp) >= crit:
- import pprint; pprint.pprint(temp)
- status = 2
- elif int(temp) >= warn:
- status = 1
- else:
- status = dell_powerconnect_temp_status2nagios_map[dell_powerconnect_status]
-
- return (status, '%s - The temperature sensor is currently (%s), and the current
temperature is %sC' %
- (nagios_state_names[status],
dell_powerconnect_temp_status_map[state], temp), [
- ("state",
dell_powerconnect_temp_sensor_state_performance_map[state], "", 0, 0, 1),
- ("temperature", int(temp), warn, crit, 0, 200),
- ])
+ if int(temp) >= crit:
+ import pprint; pprint.pprint(temp)
+ status = 2
+ elif int(temp) >= warn:
+ status = 1
+ else:
+ status = dell_powerconnect_temp_status2nagios_map[dell_powerconnect_status]
+
+ return (status, '%s - The temperature sensor is currently (%s), and the
current temperature is %sC' %
+ (nagios_state_names[status],
dell_powerconnect_temp_status_map[state], temp), [
+ ("state",
dell_powerconnect_temp_sensor_state_performance_map[state], "", 0, 0, 1),
+ ("temperature", int(temp), warn, crit, 0, 200),
+ ])
return (3, "UNKNOWN - item not found in snmp data")