Hello, its me again. Since the first check_mk plugin is running smoothly, thanks to Marius, I wrote the next plugin for an antenna and this wasn’t that funny but its working really fine. Since the Antenna is only supporting SNMP v1 you don’t discover a lot of services, its like 3 Interfaces and thats it.
I want to monitor some of the values as Metric so I followed for the Metric Stuff this docs:
But I didn’t make it so far. I tested the yield Metric(…) stuff with the rxCapacity which gets an in and the txCapcity which gets an int too.
http://www.circitor.fr/Mibs/Html/U/UBNT-AirFIBER-MIB.php#rxCapacity
Because the whole Plugin is really really long I try to add only the important parts
def check_airfiber_port(item, section):
#meassure = section[item].get(2)
#if meassure == None:
# meassure = ""
# https://docs.checkmk.com/latest/en/dev_guidelines.html
# If the Entry gets the tag "True" it will be handled as Metric
if section[item][1]:
used = int(section[item][0])
yield Metric(item, used)
#yield Result(state=State.OK, summary=section[item][0])
else:
yield Result(state=State.OK, summary=section[item][0])
section[item][0]
is the value in the case of rxCapacity and txCapacity its already an int
.
section[item][1]
is a bool
which I set in my parse function for values which I want as Metric
If I use the default Result(...)
the value will be displayed as whole number in checkmk and is marked as OK
. If I use the Metric(...)
the status switches to Unknown
and the summary is Item not found in monitoring data
. And I do not understand why this happens.
I also added under ~/local/share/check_mk/web/plugins/metrics$
an airfiber_metrics.py plugin with the following input:
from cmk.gui.i18n import _
from cmk.gui.plugins.metrics import metric_info
metric_info["rxCapacity"] = {
"title": _("rxCapacity"),
"unit": "Bits/Sec",
"color": "14/a",
}
metric_info["txCapacity"] = {
"title": _("txCapacity"),
"unit": "Bits/Sec",
"color": "15/a",
}
I also added airfiber_performeter.py too
~/local/share/check_mk/web/plugins/perfometer$
from cmk.gui.plugins.metrics import perfometer_info
perfometer_info.append({
"type": "logarithmic",
"metric": "Port rxCapacity",
"half_value": 5,
"exponent": 2.0,
})
perfometer_info.append({
"type": "logarithmic",
"metric": "Port txCapacity",
"half_value": 5,
"exponent": 2.0,
})
I want to have some Metrics / Performance data, that I can quickly see how its going
Maybe one of you have an idea how to proceed
If you need additional information, feel free to ask!
Regards Kai