From 8df29d2741c1ef93f782a30c099d61eabc881315 Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Tue, 28 Nov 2017 15:02:21 +0100 Subject: [PATCH] Added evertz_irda7881. --- src/evertz_irda7881/baseinfo.ini | 7 ++ .../checks/evertz_irda7881_demux | 59 +++++++++ .../checks/evertz_irda7881_input | 59 +++++++++ .../checks/evertz_irda7881_inputsel | 112 ++++++++++++++++++ .../checks/evertz_irda7881_inputts | 94 +++++++++++++++ .../checks/evertz_irda7881_temp | 40 +++++++ .../checks/evertz_irda7881_uptime | 39 ++++++ src/evertz_irda7881/checks/nts.include | 12 ++ .../web/htdocs/images/icons/evertz.png | Bin 0 -> 824 bytes .../perfometer/evertz_irda7881_temp.py | 20 ++++ 10 files changed, 442 insertions(+) create mode 100644 src/evertz_irda7881/baseinfo.ini create mode 100644 src/evertz_irda7881/checks/evertz_irda7881_demux create mode 100644 src/evertz_irda7881/checks/evertz_irda7881_input create mode 100644 src/evertz_irda7881/checks/evertz_irda7881_inputsel create mode 100644 src/evertz_irda7881/checks/evertz_irda7881_inputts create mode 100644 src/evertz_irda7881/checks/evertz_irda7881_temp create mode 100644 src/evertz_irda7881/checks/evertz_irda7881_uptime create mode 100644 src/evertz_irda7881/checks/nts.include create mode 100644 src/evertz_irda7881/web/htdocs/images/icons/evertz.png create mode 100644 src/evertz_irda7881/web/plugins/perfometer/evertz_irda7881_temp.py diff --git a/src/evertz_irda7881/baseinfo.ini b/src/evertz_irda7881/baseinfo.ini new file mode 100644 index 0000000..98e690f --- /dev/null +++ b/src/evertz_irda7881/baseinfo.ini @@ -0,0 +1,7 @@ +[info] +title = Evertz IRDA7881 SNMP Checks +author = Markus Birth +description = SNMP based checks for the Evertz IRDA7881 IRD. +version = 2017.07.04.1 +version.min_required = 1.2.8p2 +download_url = https://github.com/mbirth/check_mk-plugins diff --git a/src/evertz_irda7881/checks/evertz_irda7881_demux b/src/evertz_irda7881/checks/evertz_irda7881_demux new file mode 100644 index 0000000..ef66354 --- /dev/null +++ b/src/evertz_irda7881/checks/evertz_irda7881_demux @@ -0,0 +1,59 @@ +#!/usr/bin/python +# -*- coding: utf-8; py-indent-offset: 4 -*- +# _______ __ _ ____ __ +# | | \ | |___ \ / / +# | | \| | __) | / /-,_ +# | | |\ |/ __/ /__ _| +# |_______|_| \__|_____| |_| +# +# @author Markus Birth + +def inventory_evertz_irda7881_demux(info): + inventory = [] + for PMTPid, PCRPid, VideoPid, VideoCompressionType, VideoChromaFormat, VideoResolution, VideoFrameRate, VideoBitrate in info: + inventory.append( ( "Demux Info", None ) ) + return inventory + +def check_evertz_irda7881_demux(item, _no_params, info): + status = 0 + for PMTPid, PCRPid, VideoPid, VideoCompressionType, VideoChromaFormat, VideoResolution, VideoFrameRate, VideoBitrate in info: + PMTPid = int(PMTPid) + PCRPid = int(PCRPid) + VideoPid = int(VideoPid) + VideoCompressionType = snmp_nts(VideoCompressionType) + VideoChromaFormat = snmp_nts(VideoChromaFormat) + VideoResolution = snmp_nts(VideoResolution) + VideoFrameRate = snmp_nts(VideoFrameRate) + VideoBitrate = int(VideoBitrate) + + message = "PMT:%i PCR:%i Video:%i - %s with %i kbps, %s@%s (%s)" % ( PMTPid, PCRPid, VideoPid, VideoCompressionType, VideoBitrate, VideoResolution, VideoFrameRate, VideoChromaFormat ) + + perfdata = [ + ("PMT_Pid", PMTPid, None, None), + ("PCR_Pid", PCRPid, None, None), + ("Video_Pid", VideoPid, None, None), + ("Bitrate", VideoBitrate, None, None) + ] + + return status, message, perfdata + + return 3, "%s not found in SNMP data." % item + +check_info["evertz_irda7881_demux"] = { + "check_function" : check_evertz_irda7881_demux, + "inventory_function" : inventory_evertz_irda7881_demux, + "includes" : [ "nts.include" ], + "service_description" : "%s", + "snmp_info" : (".1.3.6.1.4.1.6827.50.322.17.1.1", [ + 1, #demuxPMTPid + 2, #demuxPCRPid + 3, #demuxVideoPid + 4, #demuxVideoCompressionType + 5, #demuxVideoChromaFormat + 6, #demuxVideoResolution + 7, #demuxVideoFrameRate + 8, #demuxVideoBitrate + ]), + "snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.6827.50.322.2.1.1.1.1"), + "has_perfdata" : True +} diff --git a/src/evertz_irda7881/checks/evertz_irda7881_input b/src/evertz_irda7881/checks/evertz_irda7881_input new file mode 100644 index 0000000..5d8f7db --- /dev/null +++ b/src/evertz_irda7881/checks/evertz_irda7881_input @@ -0,0 +1,59 @@ +#!/usr/bin/python +# -*- coding: utf-8; py-indent-offset: 4 -*- +# _______ __ _ ____ __ +# | | \ | |___ \ / / +# | | \| | __) | / /-,_ +# | | |\ |/ __/ /__ _| +# |_______|_| \__|_____| |_| +# +# @author Markus Birth + +def inventory_evertz_irda7881_input(info): + inventory = [] + for inputStatus, inputBitrate, inputPacketFraming, inputNumTSPackets, inputProgramName, inputProgramNumber in info: + inventory.append( ( "Input Info", None ) ) + return inventory + +def check_evertz_irda7881_input(item, _no_params, info): + status = 0 + for inputStatus, inputBitrate, inputPacketFraming, inputNumTSPackets, inputProgramName, inputProgramNumber in info: + packetFramings = ["n/a", "UDP", "RTP"] + inputStatus = snmp_nts(inputStatus) + inputProgramName = snmp_nts(inputProgramName) + packetFraming = packetFramings[int(inputPacketFraming)] + inputBitrate = int(inputBitrate) + inputNumTSPackets = int(inputNumTSPackets) + inputProgramNumber = int(inputProgramNumber) + + message = "%s (%i: %s), %i kbps, %s, %i TS per IP packet" % ( inputStatus, inputProgramNumber, inputProgramName, inputBitrate, packetFraming, inputNumTSPackets ) + + if inputStatus != "Present": + status = 1 + + perfdata = [ + ("Pgm_Number", inputProgramNumber, None, None), + ("Bitrate", inputBitrate, None, None), + ("Packet_Framing", int(inputPacketFraming), None, None), + ("NumTSPackets", inputNumTSPackets, None, None) + ] + + return status, message, perfdata + + return 3, "%s not found in SNMP data." % item + +check_info["evertz_irda7881_input"] = { + "check_function" : check_evertz_irda7881_input, + "inventory_function" : inventory_evertz_irda7881_input, + "includes" : [ "nts.include" ], + "service_description" : "%s", + "snmp_info" : (".1.3.6.1.4.1.6827.50.322.16.1.1", [ + 1, #inputStatus + 2, #inputBitrate + 3, #inputPacketFraming + 4, #inputNumTSPackets + 5, #inputProgramName + 6, #inputProgramNumber + ]), + "snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.6827.50.322.2.1.1.1.1"), + "has_perfdata" : True +} diff --git a/src/evertz_irda7881/checks/evertz_irda7881_inputsel b/src/evertz_irda7881/checks/evertz_irda7881_inputsel new file mode 100644 index 0000000..85c46ed --- /dev/null +++ b/src/evertz_irda7881/checks/evertz_irda7881_inputsel @@ -0,0 +1,112 @@ +#!/usr/bin/python +# -*- coding: utf-8; py-indent-offset: 4 -*- +# _______ __ _ ____ __ +# | | \ | |___ \ / / +# | | \| | __) | / /-,_ +# | | |\ |/ __/ /__ _| +# |_______|_| \__|_____| |_| +# +# @author Markus Birth + +def inventory_evertz_irda7881_inputsel(info): + inventory = [] + for inputPortSelect, inputIPAddress, inputIPPortNumber, inputIGMPV3Mode, programTuningMode, autoProgramSelMode, \ + programNumberSelect, videoPidSelect, pcrPidSelect, vancPidSelect, pidConfiguration, videoDecoderDelay, \ + inputForceInterlace, serviceNameSelect, inputBitErrorID, adaptiveLatency, manualPidSelectView in info: + inventory.append( ( "Input Selection", None ) ) + return inventory + +def check_evertz_irda7881_inputsel(item, _no_params, info): + status = 0 + for inputPortSelect, inputIPAddress, inputIPPortNumber, inputIGMPV3Mode, programTuningMode, autoProgramSelMode, \ + programNumberSelect, videoPidSelect, pcrPidSelect, vancPidSelect, pidConfiguration, videoDecoderDelay, \ + inputForceInterlace, serviceNameSelect, inputBitErrorID, adaptiveLatency, manualPidSelectView in info: + + ports = ["n/a", "sfp0", "sfp1", "asi0", "asi1"] + igmpv3Modes = ["n/a", "include", "exclude"] + tuningModes = ["n/a", "AUTO", "MAN"] + autoProgSelModes = ["n/a", "firstProgramInPAT", "lowestProgramNum", "specificProgramSelect", "specificServiceName"] + pidConfigs = ["n/a", "preAssigned", "user"] + forceInterlaces = ["n/a", "disable", "enable"] + adaptiveLatencies = ["n/a", "on", "off", "min"] + manPidSelects = ["n/a", "showAllPids", "showPidsInProgram"] + + inputPort = ports[int(inputPortSelect)] + inputIPAddress = snmp_nts(inputIPAddress) + inputIPPortNumber = int(inputIPPortNumber) + igmpv3Mode = igmpv3Modes[int(inputIGMPV3Mode)] + tuningMode = tuningModes[int(programTuningMode)] + progSelMode = autoProgSelModes[int(autoProgramSelMode)] + programNumberSelect = int(programNumberSelect) + videoPidSelect = int(videoPidSelect) + pcrPidSelect = int(pcrPidSelect) + vancPidSelect = int(vancPidSelect) + pidConfig = pidConfigs[int(pidConfiguration)] + videoDecoderDelay = int(videoDecoderDelay) + forceInterlace = forceInterlaces[int(inputForceInterlace)] + serviceNameSelect = snmp_nts(serviceNameSelect) + inputBitErrorID = snmp_nts(inputBitErrorID) + adaptiveLat = adaptiveLatencies[int(adaptiveLatency)] + manPidSelect = manPidSelects[int(manualPidSelectView)] + + message = "%s" % (tuningMode) + + if int(programTuningMode) == 1: + # autoPidSelect + message += " (%s: %i, %s)" % (progSelMode, programNumberSelect, serviceNameSelect) + else: + # manualPidSelect + message += " (vid:%i pcr:%i vanc:%i)" % (videoPidSelect, pcrPidSelect, vancPidSelect) + + message += ", pidConf:%s, %s" % (pidConfig, manPidSelect) + message2 = "\nVideo Decoder Delay: %i ms" % (videoDecoderDelay) + message2 += "\nForce Interlace: %s" % (forceInterlace) + message2 += "\nInput Bit Error ID: %s" % (inputBitErrorID) + message2 += "\nAdaptive Latency: %s" % (adaptiveLat) + + perfdata = [ + ("inputPort", int(inputPortSelect), None, None), + ("tuningMode", int(programTuningMode), None, None), + ("progSelMode", int(autoProgramSelMode), None, None), + ("progNumSel", programNumberSelect, None, None), + ("videoPidSel", videoPidSelect, None, None), + ("pcrPidSel", pcrPidSelect, None, None), + ("vancPidSel", vancPidSelect, None, None), + ("pidConfig", int(pidConfiguration), None, None), + ("videoDecDelay", videoDecoderDelay, None, None), + ("forceInterlace", int(inputForceInterlace), None, None), + ("adaptiveLatency", int(adaptiveLatency), None, None), + ("manPidSelectView", int(manualPidSelectView), None, None), + ] + + return 0, message + message2, perfdata + + return 3, "%s not found in SNMP data." % item + +check_info["evertz_irda7881_inputsel"] = { + "check_function" : check_evertz_irda7881_inputsel, + "inventory_function" : inventory_evertz_irda7881_inputsel, + "includes" : [ "nts.include" ], + "service_description" : "%s", + "snmp_info" : (".1.3.6.1.4.1.6827.50.322.8.1.1", [ + 1, #inputPortSelect + 2, #inputIPAddress + 3, #inputIPPortNumber + 4, #inputIGMPV3Mode + 5, #programTuningMode + 6, #autoProgramSelMode + 7, #programNumberSelect + 8, #videoPidSelect + 9, #pcrPidSelect + 10, #vancPidSelect + 11, #pidConfiguration + 15, #videoDecoderDelay + 17, #inputForceInterlace + 18, #serviceNameSelect + 19, #inputBitErrorID + 20, #adaptiveLatency + 21, #manualPidSelectView + ]), + "snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.6827.50.322.2.1.1.1.1"), + "has_perfdata" : True +} diff --git a/src/evertz_irda7881/checks/evertz_irda7881_inputts b/src/evertz_irda7881/checks/evertz_irda7881_inputts new file mode 100644 index 0000000..3c790ad --- /dev/null +++ b/src/evertz_irda7881/checks/evertz_irda7881_inputts @@ -0,0 +1,94 @@ +#!/usr/bin/python +# -*- coding: utf-8; py-indent-offset: 4 -*- +# _______ __ _ ____ __ +# | | \ | |___ \ / / +# | | \| | __) | / /-,_ +# | | |\ |/ __/ /__ _| +# |_______|_| \__|_____| |_| +# +# @author Markus Birth + +def inventory_evertz_irda7881_inputts(info): + inventory = [] + for tsInputSourceSelect, tsInPrimarySource, tsInSecondarySource, tsInSourceSelectMode, tsInSourceInUse, \ + tsInASIPres, tsInBitrate, tsInPIDCount, tsInSyncLossErr, tsInSyncByteErr, tsInCCErr in info: + inventory.append( ( "Input TS Selection", None ) ) + return inventory + +def check_evertz_irda7881_inputts(item, _no_params, info): + status = 0 + for tsInputSourceSelect, tsInPrimarySource, tsInSecondarySource, tsInSourceSelectMode, tsInSourceInUse, \ + tsInASIPres, tsInBitrate, tsInPIDCount, tsInSyncLossErr, tsInSyncByteErr, tsInCCErr in info: + sources = ["n/a", "demod1", "demod2", "demod3", "demod4", "asi", "ip"] + select_modes = ["n/a", "forcePri", "forceSec", "auto"] + source_in_uses = ["n/a", "main", "backup", "na"] + presences = ["n/a", "loss", "present"] + + usedSource = sources[int(tsInputSourceSelect)] + priSource = sources[int(tsInPrimarySource)] + secSource = sources[int(tsInSecondarySource)] + selectMode = select_modes[int(tsInSourceSelectMode)] + sourceSel = source_in_uses[int(tsInSourceInUse)] + asiPresent = presences[int(tsInASIPres)] + tsInBitrate = int(tsInBitrate) + tsInPIDCount = int(tsInPIDCount) + tsInSyncLossErr = int(tsInSyncLossErr) + tsInSyncByteErr = int(tsInSyncByteErr) + tsInCCErr = int(tsInCCErr) + + message = "Mode:%s " % (selectMode) + + if sourceSel == "main": + message += "❶▶%s◀ ➁▷%s◁" % (priSource, secSource) + elif sourceSel == "backup": + message += "➀▷%s◁ ❷▶%s◀" % (priSource, secSource) + else: + message += "SOURCE SELECTION: %s" % (sourceSel) + + message += ", %i kbps" % (tsInBitrate) + message += ", ASI:%s" % (asiPresent) + message += ", %i PIDs found" % (tsInPIDCount) + + message2 = "\nSync losses: %i" % (tsInSyncLossErr) + message2 += "\nSync byte errors: %i" % (tsInSyncByteErr) + message2 += "\nContinuity count errors: %i" % (tsInCCErr) + + perfdata = [ + ("inputSourceSelect", int(tsInputSourceSelect), None, None), + ("inPrimarySource", int(tsInPrimarySource), None, None), + ("inSecondarySource", int(tsInSecondarySource), None, None), + ("inSourceSelectMode", int(tsInSourceSelectMode), None, None), + ("inSourceInUse", int(tsInSourceInUse), None, None), + ("inASIPres", int(tsInASIPres), None, None), + ("inBitrate", tsInBitrate, None, None), + ("inPIDCount", tsInPIDCount, None, None), + ("inSyncLossErr", tsInSyncLossErr, None, None), + ("inSyncByteErr", tsInSyncByteErr, None, None), + ("inCCErr", tsInCCErr, None, None), + ] + + return 0, message + message2, perfdata + + return 3, "%s not found in SNMP data." % item + +check_info["evertz_irda7881_inputts"] = { + "check_function" : check_evertz_irda7881_inputts, + "inventory_function" : inventory_evertz_irda7881_inputts, + "includes" : [ "nts.include" ], + "service_description" : "%s", + "snmp_info" : (".1.3.6.1.4.1.6827.50.322.41.1.1", [ + 1, #tsInputSourceSelect + 2, #tsInPrimarySource + 3, #tsInSecondarySource + 4, #tsInSourceSelectMode + 5, #tsInSourceInUse + 6, #tsInASIPres + 7, #tsInBitrate + 8, #tsInPIDCount + 9, #tsInSyncLossErr + 10, #tsInSyncByteErr + 11, #tsInCCErr + ]), + "snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.6827.50.322.2.1.1.1.1"), + "has_perfdata" : True +} diff --git a/src/evertz_irda7881/checks/evertz_irda7881_temp b/src/evertz_irda7881/checks/evertz_irda7881_temp new file mode 100644 index 0000000..311d3cd --- /dev/null +++ b/src/evertz_irda7881/checks/evertz_irda7881_temp @@ -0,0 +1,40 @@ +#!/usr/bin/python +# -*- coding: utf-8; py-indent-offset: 4 -*- +# _______ __ _ ____ __ +# | | \ | |___ \ / / +# | | \| | __) | / /-,_ +# | | |\ |/ __/ /__ _| +# |_______|_| \__|_____| |_| +# +# @author Markus Birth + +def inventory_evertz_irda7881_temp(info): + inventory = [] + for oidend, fpgaTemp in info: + inventory.append( ( "FPGA Temperature", None ) ) + return inventory + +def check_evertz_irda7881_temp(item, _no_params, info): + status = 0 + for oidend, fpgaTemp in info: + fpgaTemp = int(fpgaTemp) + + message = u"%i℃" % ( fpgaTemp ) + + perfdata = [ ("FPGA_Temp", fpgaTemp, None, None, -100, 100) ] + + return status, message, perfdata + + return 3, "%s not found in SNMP data." % item + +check_info["evertz_irda7881_temp"] = { + "check_function" : check_evertz_irda7881_temp, + "inventory_function" : inventory_evertz_irda7881_temp, + "service_description" : "%s", + "snmp_info" : (".1.3.6.1.4.1.6827.50.322.48.1.1.1", [ + OID_END, + 1, #fpgaTemp + ]), + "snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.6827.50.322.2.1.1.1.1"), + "has_perfdata" : True +} diff --git a/src/evertz_irda7881/checks/evertz_irda7881_uptime b/src/evertz_irda7881/checks/evertz_irda7881_uptime new file mode 100644 index 0000000..2857231 --- /dev/null +++ b/src/evertz_irda7881/checks/evertz_irda7881_uptime @@ -0,0 +1,39 @@ +#!/usr/bin/python +# -*- coding: utf-8; py-indent-offset: 4 -*- +# _______ __ _ ____ __ +# | | \ | |___ \ / / +# | | \| | __) | / /-,_ +# | | |\ |/ __/ /__ _| +# |_______|_| \__|_____| |_| +# +# @author Markus Birth + +def inventory_evertz_irda7881_uptime(info): + inventory = [] + for oidend, decoderUpTime in info: + inventory.append( ( "Decoder Uptime", None ) ) + return inventory + +def check_evertz_irda7881_uptime(item, _no_params, info): + status = 0 + for oidend, decoderUpTime in info: + decoderUpTime = snmp_nts(decoderUpTime) + + message = "up for %s" % ( decoderUpTime ) + + return status, message + + return 3, "%s not found in SNMP data." % item + +check_info["evertz_irda7881_uptime"] = { + "check_function" : check_evertz_irda7881_uptime, + "inventory_function" : inventory_evertz_irda7881_uptime, + "includes" : [ "nts.include" ], + "service_description" : "%s", + "snmp_info" : (".1.3.6.1.4.1.6827.50.322.8.1.1.12", [ + OID_END, + 1, #decoderUpTime + ]), + "snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.6827.50.322.2.1.1.1.1"), + "has_perfdata" : False +} diff --git a/src/evertz_irda7881/checks/nts.include b/src/evertz_irda7881/checks/nts.include new file mode 100644 index 0000000..061b65c --- /dev/null +++ b/src/evertz_irda7881/checks/nts.include @@ -0,0 +1,12 @@ +#!/usr/bin/python +# -*- coding: utf-8; py-indent-offset: 4 -*- +# _______ __ _ ____ __ +# | | \ | |___ \ / / +# | | \| | __) | / /-,_ +# | | |\ |/ __/ /__ _| +# |_______|_| \__|_____| |_| +# +# @author Markus Birth + +def snmp_nts(input_value): + return str(input_value).split(b'\0', 1)[0] diff --git a/src/evertz_irda7881/web/htdocs/images/icons/evertz.png b/src/evertz_irda7881/web/htdocs/images/icons/evertz.png new file mode 100644 index 0000000000000000000000000000000000000000..967cc235a87ee2ff097b17723603f9ae9f88a8f1 GIT binary patch literal 824 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPfdtD69Mgd`SU*F|v9*U87?=`0T^vI!PEVbD-+OYP%rX1-yEn)0TkmUL zsw=alF~p5cY)Wf*TT{nh?zD?j#Ust{RSMs&3@ztsHNV)pL5XXX<3#aku~TkrQxoON zz5MsX+1$L#xy!q+cQ26mdZ4k`;(5*a&vTyt)VjVta&B_+)(NXy9aaAGv3{z|Iu&*1 zRhP@^^U8uZ)ulxy2)!!Z5W)9O`@-eLIg@X0k&)bgDBZzKYFD4l?QW4nG2D%NOjjOp zU8*#ji*?o2)Nl zHB0o{_k(x2w$9qQkin_ptXq`sJ1=pe-%ofm$`0NN?>LrV%)8w0a2Cra))iOJR=Ts_ z*~u&Z+ac7m(}&IfJLj9jhZ8m*KE*ZVw15Ry9{&p~9zLfk?znwT`?w8ESo9A)D3}n` z?HV(;?#LUNoHfqX)<0?jv<{!)VPTqZ_Rw+v2|kDR?iT2E((1foQk0a=KK*>Vl>x&c zrrT^&ye?d03l6@p#`%R|N^ye3g=)5G(-kK!dG&SE(rZ~ev_+?+`zO}jD@n}f-&f!4 z&YzgcdCmO5OB4GY`{l*N4x}x;^-OX7yC;@^E;qao-(Y3dlbHU@o${8CM{%L4 zNR#u~g8z&yhd2B=IHhot^u4|95j>MPD}EnKnd0f}t-X7f-sd}WRPRi{FN21Eg6}xu*>&ZXt7NQ`buz#1Ar^W1oIoAK>b88wd=^dLaFg1Rz$xr|3d~UhG zl&4za8c~vxSdwa$T$Bo=7>o=IO?3^7bPWwc3{9+z%&m;fv<(cc3=HTL-jxn44$rjF6*2UngI46Q`7(e literal 0 HcmV?d00001 diff --git a/src/evertz_irda7881/web/plugins/perfometer/evertz_irda7881_temp.py b/src/evertz_irda7881/web/plugins/perfometer/evertz_irda7881_temp.py new file mode 100644 index 0000000..1eef4c1 --- /dev/null +++ b/src/evertz_irda7881/web/plugins/perfometer/evertz_irda7881_temp.py @@ -0,0 +1,20 @@ +#!/usr/bin/python +# -*- coding: utf-8; py-indent-offset: 4 -*- +# _______ __ _ ____ __ +# | | \ | |___ \ / / +# | | \| | __) | / /-,_ +# | | |\ |/ __/ /__ _| +# |_______|_| \__|_____| |_| +# +# @author Markus Birth + +def perfometer_evertz_irda7881_temp(row, check_command, perfdata): + if len(perfdata) < 1: + return "", "" + + tcur = int(perfdata[0][1]) + tmax = int(perfdata[0][6]) + + return "%i℃" % tcur, perfometer_linear(tcur*100/tmax, "#f82") + +perfometers["check_mk-evertz_irda7881_temp"] = perfometer_evertz_irda7881_temp