Cannot make SNMPv1-connect to agent with SNMPv3 disabled/deleted

Frank.Fock____t-online.de Frank.Fock____t-online.de
Wed Mar 5 11:28:40 CET 2003


Hi Bjoern,

If you do not need SNMPv3, then the easiest way
is to compile SNMP++, AGENT++, and your agent
with _NO_SNMPv3 defined. If you compile with
_SNMPv3 you must not remove the SNMPv3 MIBs
and the VACM initialization! 

Also, I recognized a "init_signals()" in your
code, may if you remove it, you will also get
a core dump when the agent crashes (yesterday's
problem ;-)

Hope this helps.

Best regards,
Frank


Bjoern.Schorre____RSBICK.rohde-schwarz.com schrieb:
> Hi,
> 
> I tailered the example *atm_mib* from the
> "agent++-archive" to get a very simple
> agent, with only the *sysGroup* and *snmpGroup*
> supported. Aftre this I'm going
> to add some own MIBs.
> 
> Unfourtnatley, after deleting all SNMPv3-Code my agent
> results in the errors
> below.
> 
> 
> 1.
> I'm just trying to connect to my agent via SNMPv1. When
> contacting the agent
> crashes with a *segmentation fault*.
> 
> --------- Init MIB
> ------------------------------------------
> void init(Mib& mib)
> {
>   OctetStr sysDescr("bsc_test");
>   mib.add(new sysGroup(sysDescr.get_printable(),
> "1.3.6.1.4.1.4976",
>   mib.add(new snmpGroup());
> 
>   mib.add(new snmp_target_mib());
>   mib.add(new snmp_notification_mib());
> 
> //  mib.add(new agentpp_notifytest_mib());
> //  mib.add(new agentpp_test_mib());
> }
> ---------------------------------------------------
> 
> ------- Main
> --------------------------------------------
> [...]
>   mib = new Mib();
>   reqList = new RequestList();
>   // register requestList for outgoing requests
>   mib->set_request_list(reqList);
> 
>   init_signals();
> 
>   // add supported objects
>   init(*mib);
> 
>   // load persitent objects from disk
>   mib->init();
> 
>   reqList->set_snmp(&snmp);
> 
> 
>   Vbx* vbs = 0;
>   coldStartOid coldOid;
>   NotificationOriginator no;
>   UdpAddress dest("172.20.16.245/162");
>   cout << "Marke 01" << endl;
> 
>   no.add_v1_trap_destination(dest);
>   cout << "Marke 02" << endl;
> 
> //  no.generate(vbs, 0, coldOid, "", "");
>   cout << "Marke 03" << endl;
> 
> 
>   Request* req;
>   while (run)
>   {
>     req = reqList->receive(2);
> 
>     if (req)
>     {
>       mib->process_request(req);
>     }
>     else
>     {
>       mib->cleanup();
>     }
>   }
>   delete mib;
>   return 0;
> }
> ---------------------------------------------------
> 
> 
> 2.
> The second question is, the agent will also crashes, when
> trying to send a trap:
>          //  no.generate(vbs, 0, coldOid, "", "");
> 
> 
> Perhaps both problems bases on the same error - I don't
> know.
> 
> 
> 
> Best regards
> Bjoern
> 
> 
> 
> 
> 
> 
> 
>



More information about the AGENTPP mailing list