#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | # | | |___| | | | __/ (__| < | | | | . \ | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | # | | # | Copyright Mathias Kettner 2010 mk@mathias-kettner.de | # +------------------------------------------------------------------+ # # This file is part of Check_MK. # The official homepage is at http://mathias-kettner.de/check_mk. # # check_mk is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation in version 2. check_mk is distributed # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. See the GNU General Public License for more de- # ails. You should have received a copy of the GNU General Public # License along with GNU Make; see the file COPYING. If not, write # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. # Author: Matthias Henze def inventory_synology_system(checkname, info): inventory = [] inventory.append(("System Status", None)) inventory.append(("Power Status", None)) inventory.append(("System Fan", None)) inventory.append(("CPU Fan", None)) return inventory def check_synology_system(item, params, info): if item == "System Status": if info[0][0] == "1": return (0, "OK - System Status is OK") if info[0][0] == "2": return (2, "CRIT - System Status failed") if item == "Power Status": if info[0][1] == "1": return (0, "OK - Power Status is OK") if info[0][1] == "2": return (2, "CRIT - Power Status failed") if item == "System Fan": if info[0][2] == "1": return (0, "OK - System Fan is OK") if info[0][2] == "2": return (2, "CRIT - System Fan failed") if item == "CPU Fan": if info[0][3] == "1": return (0, "OK - CPU Fan is OK") if info[0][3] == "2": return (2, "CRIT - CPU Fan failed") return (3, "UNKNOWN - No SNMP Output from agent") check_info['synology_system'] = (check_synology_system, "Synonlogy %s", 1, inventory_synology_system) snmp_info['synology_system'] = ( ".1.3.6.1.4.1.6574.1", ["1.0","3.0","4.1.0","4.2.0"] ) def synology_system_scan_function(oid): return oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.8072") snmp_scan_functions['synology_system'] = synology_system_scan_function