Hello,
I am having a problem with the net-snmp api.
I have written a code which is based on the code located at
http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demoapp/index.html . The only difference is that I included all that code in a fuction which I call several times from the main function (Which I coded as a CLI) and that I only used v 3. The idea of the function I developed is to act similar the snmp get command. Everything works properly in normal operation.
The problem is that there are two computers that has the snmp agent and they switch between each other to be the active computer. When they switch the snmp configuration parameters (user, password and ip) remains the same so it should be possible to continue using my snmpget function without problems (because the session is opened inside this function). Unfortunatelly this does not happen. Despite the fact that the session is opened correctly when I read the data I get a timeout error. If I exit the cli and start it again everything works fine.
I tried to use the function "snmp_shutdown ("snmpapp")" at the end of my snmpget function but when I call for the second time the function the session can not be opened and I get this error:
No log handling enabled - turning on stderr logging
No support for requested transport domain "udp"
Session: Unknown host ( 127.0.0.1 )
No support for requested transport domain "udp"
Session: Unknown host ( 127.0.0.1 )
Even though the snmp agent continues working fine (using the snmpget command I can retrieve the data).
Perhaps, snmp has some static variables defined which are only cleaned when restarting the cli.
Can anyone help me with this?
Thank you very much,
Rafael
PD: The snmp version is NET-SNMP version: 5.1.2
