Added evertz_irda7881.
This commit is contained in:
@@ -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
|
||||
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8; py-indent-offset: 4 -*-
|
||||
# _______ __ _ ____ __
|
||||
# | | \ | |___ \ / /
|
||||
# | | \| | __) | / /-,_
|
||||
# | | |\ |/ __/ /__ _|
|
||||
# |_______|_| \__|_____| |_|
|
||||
#
|
||||
# @author Markus Birth <markus.birth@weltn24.de>
|
||||
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8; py-indent-offset: 4 -*-
|
||||
# _______ __ _ ____ __
|
||||
# | | \ | |___ \ / /
|
||||
# | | \| | __) | / /-,_
|
||||
# | | |\ |/ __/ /__ _|
|
||||
# |_______|_| \__|_____| |_|
|
||||
#
|
||||
# @author Markus Birth <markus.birth@weltn24.de>
|
||||
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8; py-indent-offset: 4 -*-
|
||||
# _______ __ _ ____ __
|
||||
# | | \ | |___ \ / /
|
||||
# | | \| | __) | / /-,_
|
||||
# | | |\ |/ __/ /__ _|
|
||||
# |_______|_| \__|_____| |_|
|
||||
#
|
||||
# @author Markus Birth <markus.birth@weltn24.de>
|
||||
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8; py-indent-offset: 4 -*-
|
||||
# _______ __ _ ____ __
|
||||
# | | \ | |___ \ / /
|
||||
# | | \| | __) | / /-,_
|
||||
# | | |\ |/ __/ /__ _|
|
||||
# |_______|_| \__|_____| |_|
|
||||
#
|
||||
# @author Markus Birth <markus.birth@weltn24.de>
|
||||
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8; py-indent-offset: 4 -*-
|
||||
# _______ __ _ ____ __
|
||||
# | | \ | |___ \ / /
|
||||
# | | \| | __) | / /-,_
|
||||
# | | |\ |/ __/ /__ _|
|
||||
# |_______|_| \__|_____| |_|
|
||||
#
|
||||
# @author Markus Birth <markus.birth@weltn24.de>
|
||||
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8; py-indent-offset: 4 -*-
|
||||
# _______ __ _ ____ __
|
||||
# | | \ | |___ \ / /
|
||||
# | | \| | __) | / /-,_
|
||||
# | | |\ |/ __/ /__ _|
|
||||
# |_______|_| \__|_____| |_|
|
||||
#
|
||||
# @author Markus Birth <markus.birth@weltn24.de>
|
||||
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8; py-indent-offset: 4 -*-
|
||||
# _______ __ _ ____ __
|
||||
# | | \ | |___ \ / /
|
||||
# | | \| | __) | / /-,_
|
||||
# | | |\ |/ __/ /__ _|
|
||||
# |_______|_| \__|_____| |_|
|
||||
#
|
||||
# @author Markus Birth <markus.birth@weltn24.de>
|
||||
|
||||
def snmp_nts(input_value):
|
||||
return str(input_value).split(b'\0', 1)[0]
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 824 B |
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8; py-indent-offset: 4 -*-
|
||||
# _______ __ _ ____ __
|
||||
# | | \ | |___ \ / /
|
||||
# | | \| | __) | / /-,_
|
||||
# | | |\ |/ __/ /__ _|
|
||||
# |_______|_| \__|_____| |_|
|
||||
#
|
||||
# @author Markus Birth <markus.birth@weltn24.de>
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user