[AGENT++] Privacy and authentication in traps

Michele Marcon M.Marcon at riello-ups.com
Wed Apr 20 10:24:37 CEST 2011


>> I'm sending SNMPv3 traps, but they don't have authentication nor
>> privacy enabled, even though the MD5DES user has authentication
>> and privacy working for get and set.
>>
>> no.add_v3_trap_destination(dest, "defaultV3Trap", "v3trap", "MD5DES");

>please either update to the latest version of agent++ or change the
>add_v3_trap_destination() function (of the old version that you are
>currently using) to add the entry with the desired security level.

I'm using AGENT++ API Version 3.5.31, and this is the add_v3_trap_destination() I'm using:



boolean NotificationOriginator::add_v3_trap_destination(const UdpAddress& addr,
    const OctetStr &name, const OctetStr &tag, const OctetStr &secName)
{
//      OctetStr name("defaultV3Trap");
//      OctetStr tag("v3trap");
//      OctetStr secName("MD5DES");
        OctetStr address;
        IpAddress ip(addr);
        for (int i=0; i<addr.get_length()-2; i++) {
                address += (unsigned char)ip[i];
        }
        address += (addr.get_port() >> 8);
        address += (addr.get_port() & 0x00FF);

        if (!snmpTargetParamsEntry::instance ||
            !snmpTargetAddrEntry::instance)
            return FALSE;

        if (snmpTargetParamsEntry::instance->add_entry(name, // row index
                                                       mpV3,    // mpModel
                                                       SNMP_SECURITY_MODEL_USM,
                                                       secName, // secName
                                                       1)) { // secLevel
            snmpNotifyEntry::instance->add_entry(name, // row index
                                                 tag,  // tag
                                                 TRAP);   // type (trap)
        }
        if (snmpTargetAddrEntry::instance->
                add_entry(UdpAddress(addr).get_printable(),  // row index
                          Oidx("1.3.6.1.6.1.1"),    // UDP domain
                          address,                  // target address
                          tag,                      // tag
                          name))                   // params entry
                return TRUE;
        return FALSE;
}

#ifdef AGENTPP_NAMESPACE
}
#endif


Thanks!




Michele Marcon
Centro Ricerche
RPS SpA
Viale Europa, 7
37045 Legnago (VR)
Tel. +39 0442 635811 - Fax. +39 0442 635934 - Mobile: +39 335 1233317
Skype Id:  - VoIp:
E-mail: M.Marcon at riello-ups.com
Web: http://www.riello-ups.com
 -----------------------------------------------------------------------------------------------------
Per favore non stampare questo messaggio se proprio non è necessario
Please consider the environment before printing this e-mail
-----------------------------------------------------------------------------------------------------
Chi riceve il presente messaggio e` tenuto a verificare se lo stesso non gli sia pervenuto per errore. In tal caso e` pregato di avvisare immediatamente il mittente e, tenuto conto delle responsabilita` connesse all'indebito utilizzo e/o divulgazione del messaggio e/o delle informazioni in esso contenute, voglia cancellare l'originale e distruggere le varie copie o stampe.

The receiver of this message is required to check if he/she has received it erroneously. If so, the receiver is requested to immediately inform the sender and - in consideration of the responsibilities arising from undue use and/or disclosure of the message and/or the information contained therein - destroy the original message and any copy or printout thereof.







More information about the AGENTPP mailing list