[AGENT++] How to disable engine id discovery mode in Agent++

Jochen Katz katz at agentpp.com
Thu Nov 8 22:30:34 CET 2007


Hello,

> I was trying to disable the engine id discovery mode in agent++ by using
> 
> ,,,
> v3MP *v3mp = new v3MP(engineId, snmpEngineBoots, stat);
> v3mp->get_usm()->unset_discovery_mode();
> ...

this is the way to do it, and it works for me with the atm_mib example
agent.
I added your line and changed the notification originator code:
        UdpAddress dest("127.0.0.1/10162");
        no.add_v3_trap_destination(dest, "defaultV3Trap", "v3trap",
"MD5DES");

The agent tried to send a v3 inform message to the receive_trap example,
but only got unknown engine id reports back and it finally logged:
NotificationGenerator: sent inform
(vers)(id)(tdomain)(addr)(vbs)(community/secName)(status): (3),
(1.3.6.1.6.3.1.1.5.1), (1), (127.0.0.1/10162), (0), (MD5DES), (-5)

The status -5 is "timeout". This is not a good result, as snmp++/agent++
could check if discovery is enabled and deny sending a inform with empty
engine id (added this to my todo list). Nevertheless discovery is
disabled and no inform receiver can claim that it received a valid inform.

> Yet I was still able to send an SNMP request with some bogus engine ID
> to the agent and get the request processed.

With a sniffer like wireshark you should see that every inform request
results in a report message.

If you sent out snmpv3 trap messages, then you will see that this works,
as for a trap, the sender is authoritative and no discovery is needed.
You can easilye check this with the snmpTraps.cpp and snmpInform.cpp
consoleExample from snmp++. Just add the unset_discovery_mode() and try
to send traps/informs to the receive_trap example.

Regards,
  Jochen





More information about the AGENTPP mailing list