1
0

Added mayah_c12.

This commit is contained in:
Markus Birth 2017-11-28 15:02:54 +01:00
parent 140a06bfc0
commit 24f3e9c240
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
4 changed files with 122 additions and 0 deletions

View File

@ -0,0 +1,7 @@
[info]
title = Mayah C12 SNMP Checks
author = Markus Birth
description = SNMP based checks (fans, temperature) for the Mayah C12 IP/ISDN audio codec.
version = 2017.02.07.1
version.min_required = 1.2.8p2
download_url = https://github.com/mbirth/check_mk-plugins

View File

@ -0,0 +1,39 @@
#!/usr/bin/python
# -*- coding: utf-8; py-indent-offset: 4 -*-
# _______ __ _ ____ __
# | | \ | |___ \ / /
# | | \| | __) | / /-,_
# | | |\ |/ __/ /__ _|
# |_______|_| \__|_____| |_|
#
# @author Markus Birth <markus.birth@weltn24.de>
mayah_c12_fan_default_levels = { "lower": (1000, 300) }
def inventory_mayah_c12_fan(info):
inventory = []
inventory.append( ("Case", "mayah_c12_fan_default_levels") )
return inventory
def check_mayah_c12_fan(item, params, info):
hexdata = info[0][0]
if item == "Case":
rpm = int(hexdata[10:12], 16) * 100
else:
return (3, "Invalid item: %s" % item)
return check_fan(rpm, params)
check_info["mayah_c12_fan"] = {
"check_function" : check_mayah_c12_fan,
"inventory_function" : inventory_mayah_c12_fan,
"group" : "hw_fans",
"service_description" : "%s Fan",
"snmp_info" : (".1.3.6.1.4.1.6210.1", [
6, # syshealth1
]),
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.6210"),
"includes" : [ "fan.include" ],
"has_perfdata" : True
}

View File

@ -0,0 +1,42 @@
#!/usr/bin/python
# -*- coding: utf-8; py-indent-offset: 4 -*-
# _______ __ _ ____ __
# | | \ | |___ \ / /
# | | \| | __) | / /-,_
# | | |\ |/ __/ /__ _|
# |_______|_| \__|_____| |_|
#
# @author Markus Birth <markus.birth@weltn24.de>
mayah_c12_temp_default_levels = { "levels": (45, 60) }
def inventory_mayah_c12_temp(info):
inventory = []
inventory.append( ("CPU", "mayah_c12_temp_default_levels") )
inventory.append( ("Case", "mayah_c12_temp_default_levels") )
return inventory
def check_mayah_c12_temp(item, params, info):
hexdata = info[0][0]
if item == "CPU":
temp = int(hexdata[6:8], 16)
elif item == "Case":
temp = int(hexdata[4:6], 16)
else:
return (3, "Invalid item: %s" % item)
return check_temperature(temp, params, item)
check_info["mayah_c12_temp"] = {
"check_function" : check_mayah_c12_temp,
"inventory_function" : inventory_mayah_c12_temp,
"group" : "temperature",
"service_description" : "%s Temperature",
"snmp_info" : (".1.3.6.1.4.1.6210.1", [
6, # syshealth1
]),
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.6210"),
"includes" : [ "temperature.include" ],
"has_perfdata" : True
}

View File

@ -0,0 +1,34 @@
#!/usr/bin/python
# -*- coding: utf-8; py-indent-offset: 4 -*-
# _______ __ _ ____ __
# | | \ | |___ \ / /
# | | \| | __) | / /-,_
# | | |\ |/ __/ /__ _|
# |_______|_| \__|_____| |_|
#
# @author Markus Birth <markus.birth@weltn24.de>
def perfometer_mayah_c12_fan(row, check_command, perfdata):
if len(perfdata) < 1:
return "", ""
rpm = float(perfdata[0][1])
if perfdata[0][3]:
warn = float(perfdata[0][3])
else:
warn = 7000
if perfdata[0][4]:
crit = float(perfdata[0][4])
else:
crit = 8500
if rpm >= crit:
color = "#d23"
elif rpm >= warn:
color = "#dd2"
else:
color = "#2d3"
return "%i rpm" % rpm, perfometer_linear(100*rpm/crit, color)
perfometers["check_mk-mayah_c12_fan"] = perfometer_mayah_c12_fan