Page 1 of 1

snmp bug (?)

Posted: Fri Oct 04, 2024 3:35 am
by svaertis23
I'm connecting to various codecs to get the packet drops information via snmp,
While it works fine with some of them, Nagios seems to be adding "c" to some of them

That "C" is not in data but it breaks the graphs:

[[email protected] ~]$ /usr/local/nagios/libexec/check_snmp -H xx.xx.xx.xx -o 'iptecPortRxPacketErrors.1' -C 'xxx' -P 2c -m IPTEC-SERVICES-VNP-MIB -v
/bin/snmpget -Le -t 3 -r 5 -m IPTEC-SERVICES-VNP-MIB -v 2c [context] [authpriv] xx.xx.xx.xx:161 iptecPortRxPacketErrors.1
IPTEC-PORTSERVICE-COMMON-MIB::iptecPortRxPacketErrors.1 = Counter32: 323
SNMP OK - 323 | IPTEC-PORTSERVICE-COMMON-MIB::iptecPortRxPacketErrors.1=323c

cneck_snmp -v2.4.5

Where is that "c" from and how can I get rid of it?

Re: snmp bug (?)

Posted: Fri Oct 04, 2024 11:35 am
by DoubleDoubleA
Hi @svaertis23,

This may be a usage issue, and not a bug. There are two pieces of documentation I would point you to:

https://nagios-plugins.org/doc/guidelines.html

https://nagios-plugins.org/doc/man/check_snmp.html

If you look in the guidelines doc, you will see under Performance data, Notes:, 10.5, that the letter "c" denotes "a continous counter (such as bytes transmitted on an interface)".

If you then look at check_snmp under Rate Calculation at the bottom that you may want to be using the --rate option.

Your command you posted uses the -r option, which the help says is for REGEX.

If you meant to check for a rate of 5, you would want to use --rate rather than -r.

Let me know how that works for you.

Aaron

Re: snmp bug (?)

Posted: Mon Oct 07, 2024 1:45 am
by svaertis23
Thank you but if I do this, this breaks the counter, now it just says:

SNMP RATE OK - 0

where it should return actual number of dropped packets:

SNMP OK - 269

Please advise,

Cheers

Re: snmp bug (?)

Posted: Mon Oct 07, 2024 9:12 am
by svaertis23

Re: snmp bug (?)

Posted: Mon Oct 07, 2024 9:24 am
by DoubleDoubleA
Awesome, thanks for letting me know!