Ok that makes a lot of sense based on how speed is calculated with the octets. I did some implamentation using that function but I still must be understanding something incorrect cause the numbers are not lining up when i look at both ends of a connection.
here is the plugin code where i am using the function suggested.
def check_nokia_9500(item, section):
for x in section:
if item == "Interface " + x[1] + " " + x[0][2:3] + "/" + x[0][3:5]:
now = time.time()
value_store = get_value_store()
try:
inputvalue = get_rate(value_store, 'nokia_inbound_octets', now, float(x[9]), raise_overflow=False)
except GetRateError:
inputvalue = 0
try:
outboundvalue = get_rate(value_store, 'nokia_outbound_octets', now, float(x[10]), raise_overflow=False)
except GetRateError:
outboundvalue = 0
yield Metric("nokia_inbound_octets", float(inputvalue))
yield Metric("nokia_outbound_octets", float(outboundvalue))
yield Result(state = State.OK, summary = "[" + x[1] + "], Speed: " + render.nicspeed(int(x[3]) / 10))
return
elif item == "Interface " + x[0]:
yield Result(state = State.OK, summary = "[" + x[1] + "], Speed: " + render.nicspeed(int(x[3]) / 10))
return
I was hoping now with the new calculated value that is being put into the “yield metric” I would just be able to apply the “bits/s” unit in the metric file but that isn’t coming out with the right numbers. Is there a calculation I am missing? or maybe I’m not doing the get_rate correctly and so the data I’m putting in isn’t correct?