Closed kylebrandt closed 8 years ago
There have been a large number of changes to the SNMP code in the last couple of weeks or so, so if you are able to build the latest version available in the git repository, then you may well find that your issues are resolved (I certainly found that keepalived would attempt to register the same OID more than once, which might cause your problem).
To build with the traditional SNMP implementation, you need to specify --enable-snmp to configure. If you also want the new RFC compliant SNMP code, also specify --enable-snmp-rfc.
The snmpd.conf file I am using has the following contents: rocommunity public rwcommunity private master agentx
trapcommunity public trap2sink localhost:162
The last two lines are for traps, in which case you would need to run snmptrapd too (see below for source of more information).
There are new global keywords that enable SNMP in addition to the existing keyword enable-traps so that '-x' no longer needs to be specified to keepalived when it is run. The keywords are: enable-snmp-keepalived enable-snmp-checker enable-snmp enable-snmp-rfcv2 enable-snmp-rfcv3 enable-snmp-rfc
enable-snmp enables keepalived and checker, and enable-snmp-rfc enables rfcv2 and rfcv3, so if you want to match the previous functionality specify enable-snmp. Specifying -x on the keepalived command line enables all SNMP options built into keepalived.
By default, agentx master listens on udp port 161, and you can check that with netstat -anp | grep snmp. By default, keepalived will use the same.
Some more details of a working test setup are at the top of the source file _keepalived/vrrp/vrrpsnmp.c.
If you are still having problems, a copy of your config file, snmpd.conf file, and the git commit you have built the code from, along with the build options as output by configure would be helpful.
In my logs I'm getting the following repeated:
I'm not sure what do to fix this. I do have
master agentx
in the snmpd config. In the changelog I did notice the following:I don't anything listening on that TCP socket. I do have the following unix socket on the device:
But maybe that isn't related. Any advice on how to proceed, or is there more information I can provide?
Error string comes from https://github.com/winlibs/net-snmp/blob/master/agent/mibgroup/agentx/subagent.c#L832