years ago I have custominzed a check to query different snmp values. For this I have to get the snmp credentials in the inventory and check functions. I have done this with function cmk_base.config.snmp_credentials_of(host_name()).
But after updateing my instance form 1.5 to 1.6 I get the error: AttributeError (‘module’ object has no attribute ‘snmp_credentials_of’).
What is the correct function to get the snmp credentials?
Sorry but I don’t understand your way.
I have set the credentials in the properties of the host and need to access the properties in the python script of the check, witch is a customization of the original check_mk check sni_octopuse_trunks:
as far as i know you don’t need to care about the credential handling in your check. The function snmp_scan_function internally handles all the information, if it’s version 1, 2c or 3, and just gives you back all information from the oids. Just check other SNMP checks within the folder ~site/share/check_mk/checks who to deal with.
Hi @tosch,
that’s right, but the problem is, that if I set snmp_scan_function + snmp_info to get all needed snmp values, check_mk makes so many snmp querys that the check needs over a minute and it makes so many load on my phone system, that I get disconnects from calls. So it was no option to go this way. That was the reason I customized the original check.
Normally the core does a snmpwalk on the monitored hosts. There are rules to overcome this problem with hugh walks and timeouts. It was discussed several times on the english aswell the german mailing list.
Check the rules related to SNMP if they fit your requirements.
I have checked the mailling list a second time, but all I found is that it is not possible to limit the queries in the checkfunction on the result of the scanfunction. That was the reason I make my snmp_get queries in the checkfunction. If I get no way to get the credentials in 1.6, then the only way is to hardcode the credentials in my checkfunction.