1
0
This repository has been archived on 2025-03-31. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
check_mk-plugins/src/evertz_irda7881/checks/evertz_irda7881_demux
T
2017-11-28 15:02:21 +01:00

60 lines
2.5 KiB
Python

#!/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
}