Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_snmp can conflict with settings in snmp.conf #691

Open
miken32 opened this issue Mar 6, 2023 · 2 comments
Open

check_snmp can conflict with settings in snmp.conf #691

miken32 opened this issue Mar 6, 2023 · 2 comments

Comments

@miken32
Copy link

miken32 commented Mar 6, 2023

In particular, we were trying to use this tool for rate checking; the checks always came back as "UNKNOWN." We enabled verbose mode and went through check_snmp.c until we realized that our system-wide configuration setting of quickPrinting true was messing with the results.

If this tool is expecting a certain output it should be asking for it with the appropriate options (in this case by explicitly passing --quickPrinting=false to snmpget) or – more properly – importing the net-snmp libraries and doing the checks in C instead of running CLI utilities.

@miken32
Copy link
Author

miken32 commented Mar 6, 2023

Probably also worth mentioning, the output read loop in main() breaks early due to lack of separator character ":" as excpected. But the check at the end for calculate_rate doesn't take the possibility of an early exit from the loop into account. It should also be checking if total_oids > 0. We were seeing verbose outputs like this, but it probably should have been an error condition:

Previous State for 0=`????
/usr/bin/snmpget -Le -t 3 -r 5 -m ALL -v 2c [context] [authpriv] example.com:161 ifInOctets.24
IF-MIB::ifInOctets.24 4103007855
State string=`?b??
SNMP RATE UNKNOWN - | 

@sawolf
Copy link
Member

sawolf commented Mar 6, 2023

Hi @miken32, thanks for reaching out. Both of your suggestions sound reasonable - We'll be doing another bugfix release sometime this month, and I'll try to at least handle your first suggestion then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants