Module: check_mk
Branch: master
Commit: 8c049b1f61d103a346d649f22c491710d6d269b2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8c049b1f61d103…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jan 30 12:12:01 2015 +0100
Cleanup of new synology checks
---
checks/synology.include | 4 +---
checks/synology_disks | 2 +-
checks/synology_fans | 8 ++++----
checks/synology_raid | 27 +++++++++++++--------------
checks/synology_update | 10 +++++-----
5 files changed, 24 insertions(+), 27 deletions(-)
diff --git a/checks/synology.include b/checks/synology.include
index 45ee206..97c8b0d 100644
--- a/checks/synology.include
+++ b/checks/synology.include
@@ -25,6 +25,4 @@
# Boston, MA 02110-1301 USA.
def synology_scan_function(oid):
- if oid(".1.3.6.1.2.1.1.1.0").startswith("Linux") \
- and oid("1.3.6.1.4.1.6574.*"):
- return True
+ return oid(".1.3.6.1.2.1.1.1.0").startswith("Linux") and
oid("1.3.6.1.4.1.6574.*")
diff --git a/checks/synology_disks b/checks/synology_disks
index 41f2ac0..2dc2d88 100644
--- a/checks/synology_disks
+++ b/checks/synology_disks
@@ -43,7 +43,7 @@ def check_synology_disks(item, _no_params, info):
temp = int(temperature)
message = "Status: %s, Temperature: %d °C, Model: %s" % \
( states[state][0], temp, model )
- return states[state][1], message, [("temp", temp )]
+ return states[state][1], message, [("temp", temp )]
check_info["synology_disks"] = {
"check_function" : check_synology_disks,
diff --git a/checks/synology_fans b/checks/synology_fans
index af3316d..d26f8b3 100644
--- a/checks/synology_fans
+++ b/checks/synology_fans
@@ -27,21 +27,21 @@
def inventory_synology_fans(info):
return [
("System", None),
- ("CPU", None)
+ ("CPU", None)
]
-
+
def check_synology_fans(item, _no_params, info):
fan = {}
fan['System'], fan['CPU'] = map(int, info[0])
if fan[item] != 1:
- return 2, "FAN failed"
+ return 2, "Fan failed"
return 0, "No failure reported"
check_info["synology_fans"] = {
"check_function" : check_synology_fans,
"inventory_function" : inventory_synology_fans,
- "service_description" : "FAN %s",
+ "service_description" : "Fan %s",
"snmp_scan_function" : synology_scan_function,
"snmp_info" : (".1.3.6.1.4.1.6574.1.4", [
1, #System fan
diff --git a/checks/synology_raid b/checks/synology_raid
index 5bc42a4..5cdedf8 100644
--- a/checks/synology_raid
+++ b/checks/synology_raid
@@ -30,18 +30,18 @@ def inventory_synology_raid(info):
def check_synology_raid(item, _no_params, info):
states = {
- 1 : ("OK", 0),
- 2 : ("Repairing", 1),
- 3 : ("Migrating", 1),
- 4 : ("Expanding", 1),
- 5 : ("Deleting", 1),
- 6 : ("Creating", 1),
- 7 : ("RaidSyncing", 0),
- 8 : ("RaidParityChecking", 0),
- 9 : ("RaidAssembling", 1),
- 10 : ("Canceling", 1),
- 11 : ("Degrade", 2),
- 12 : ("Crashed",2 ),
+ 1 : ("OK" ,0),
+ 2 : ("Repairing" ,1),
+ 3 : ("Migrating" ,1),
+ 4 : ("Expanding" ,1),
+ 5 : ("Deleting" ,1),
+ 6 : ("Creating" ,1),
+ 7 : ("RaidSyncing" ,0),
+ 8 : ("RaidParityChecking" ,0),
+ 9 : ("RaidAssembling" ,1),
+ 10 : ("Canceling" ,1),
+ 11 : ("Degrade" ,2),
+ 12 : ("Crashed" ,2),
}
for raid, status in info:
if raid == item:
@@ -52,8 +52,7 @@ def check_synology_raid(item, _no_params, info):
check_info["synology_raid"] = {
"check_function" : check_synology_raid,
"inventory_function" : inventory_synology_raid,
- "service_description" : "Raid %s",
- "has_perfdata" : True,
+ "service_description" : "RAID %s",
"snmp_scan_function" : synology_scan_function,
"snmp_info" : (".1.3.6.1.4.1.6574.3.1.1", [
2, #raidName
diff --git a/checks/synology_update b/checks/synology_update
index ad75820..5962083 100644
--- a/checks/synology_update
+++ b/checks/synology_update
@@ -29,11 +29,11 @@ def inventory_synology_update(info):
def check_synology_update(_no_item, _no_params, info):
states = {
- 1 : ("Available", 2),
- 2 : ("Unavailable", 0),
- 3 : ("Connecting", 0),
- 4 : ("Disconnected", 2),
- 5 : ("Others", 3),
+ 1: ("Available", 2),
+ 2: ("Unavailable", 0),
+ 3: ("Connecting", 0),
+ 4: ("Disconnected", 2),
+ 5: ("Other", 3),
}
version, state = info[0]
state = int(state)