[AGENT++] change the community string in traps

Hanna Hsia hannahsia at hotmail.com
Tue Jan 24 18:36:05 CET 2006


Hi,

 

I need to change the community string in traps sent by my agent. 

I noticed it is set to "public" inside the "NotificationOriginator::add_v2_trap_destination".

Does this mean I have to rewrite that method?  

Thanks.

 

Hanna

  ----- Original Message ----- 
  From: agentpp-request at agentpp.org 
  To: agentpp at agentpp.org 
  Sent: Monday, January 23, 2006 4:00 AM
  Subject: AGENTPP Digest, Vol 24, Issue 11


  Send AGENTPP mailing list submissions to
  agentpp at agentpp.org

  To subscribe or unsubscribe via the World Wide Web, visit
  http://lists.agentpp.org/mailman/listinfo/agentpp
  or, via email, send a message with subject or body 'help' to
  agentpp-request at agentpp.org

  You can reach the person managing the list at
  agentpp-owner at agentpp.org

  When replying, please edit your Subject line so it is more specific
  than "Re: Contents of AGENTPP digest..."


  Today's Topics:

     1. Re: AW: [AGENT++] "salt" variable in snmp++ v.3.2.19 and
        segfault (Jochen Katz)
     2. Patch for QNX, Solaris, Windows Cygwin and new gcc
        (Jacek Poplawski)


  ----------------------------------------------------------------------

  Message: 1
  Date: Sun, 22 Jan 2006 21:54:09 +0100
  From: Jochen Katz <katz at agentpp.com>
  Subject: Re: AW: [AGENT++] "salt" variable in snmp++ v.3.2.19 and
  segfault
  To: agentpp at agentpp.org
  Message-ID: <43D3F0F1.9040007 at 2006.joka.homelinux.org>
  Content-Type: text/plain; charset=us-ascii

  Hi,

  > BTW I made some small modifications (#define, #ifdef, etc) to compile
  > snmp++ on QNX NEUTRINO and on WIN32 Cygwin, can I post patches here?

  if the patches aren't too big, you can post them to the list. But you're
  also free to send them directly to me.

  General note for all: Patches are always welcome...

  Regards,
    Jochen


  ------------------------------

  Message: 2
  Date: Mon, 23 Jan 2006 09:40:23 +0100
  From: Jacek Poplawski <jacekp at s3group.com.pl>
  Subject: [AGENT++] Patch for QNX, Solaris, Windows Cygwin and new gcc
  To: agentpp at agentpp.org
  Message-ID: <43D49677.5060205 at s3group.com.pl>
  Content-Type: text/plain; charset="iso-8859-2"

  This patch solves following issues with compiling snmp++:
  - gethostbyname syntax on QNX
  - disable SNMP_PP_IPv6 on some platforms
  - <unistd.h> breaks QNX and Solaris
  - Windows/Cygwin problems
  - semicolon breaks compilation on new gcc

  I am aware of fact that these fixes are not really elegant, so you may 
  just use some information from it and produce your own changes, anyway - 
  functionality is there.


  The information contained in this e-mail and in any attachments is confidential and is designated solely for the attention of the intended recipient(s). If you are not an intended recipient, you must not use, disclose, copy, distribute or retain this e-mail or any part thereof. If you have received this e-mail in error, please notify the sender by return e-mail and delete all copies of this e-mail from your computer system(s).
  Please direct any additional queries to: communications at s3group.com.
  Thank You.
  -------------- next part --------------
  diff -Naur snmp++v3.2.20-original/include/snmp_pp/address.h snmp++v3.2.20/include/snmp_pp/address.h
  --- snmp++v3.2.20-original/include/snmp_pp/address.h 2006-01-23 09:26:43.000000000 +0100
  +++ snmp++v3.2.20/include/snmp_pp/address.h 2006-01-23 09:25:34.000000000 +0100
  @@ -87,7 +87,7 @@
   // The /**/ stuff below is meant to fool MS C++ into skipping these
   // files when creating its makefile.  8-Dec-95 TM
   #ifndef _AIX
  -#include /**/ <unistd.h>
  +//#include /**/ <unistd.h>
   #endif
   #include /**/ <sys/socket.h>
   #include /**/ <netinet/in.h>
  diff -Naur snmp++v3.2.20-original/include/snmp_pp/config_snmp_pp.h snmp++v3.2.20/include/snmp_pp/config_snmp_pp.h
  --- snmp++v3.2.20-original/include/snmp_pp/config_snmp_pp.h 2006-01-23 09:26:43.000000000 +0100
  +++ snmp++v3.2.20/include/snmp_pp/config_snmp_pp.h 2006-01-23 09:30:26.000000000 +0100
  @@ -113,6 +114,10 @@
   #endif
   #endif
   
  +#if defined WIN32
  +#undef HAVE_INET_ATON
  +#endif
  +
   // If IPv6 is enabled assume that inet_pton() is available
   // If IPv6 and gcc then assume gethostbyname2() is available
   #ifdef SNMP_PP_IPv6
  @@ -124,7 +129,11 @@
   
   // can we use the reentrant version of these functions or
   // are the standard functions thread safe
  -#ifdef __GNUC__
  +#ifdef WIN32
  +#define HAVE_REENTRANT_GETHOSTBYNAME
  +#define HAVE_LOCALTIME_R
  +#define HAVE_REENTRANT_GETHOSTBYADDR
  +#elif __GNUC__
   #define HAVE_GETHOSTBYNAME_R
   #define HAVE_LOCALTIME_R
   #define HAVE_GETHOSTBYADDR_R
  diff -Naur snmp++v3.2.20-original/include/snmp_pp/oid.h snmp++v3.2.20/include/snmp_pp/oid.h
  --- snmp++v3.2.20-original/include/snmp_pp/oid.h 2006-01-23 09:26:43.000000000 +0100
  +++ snmp++v3.2.20/include/snmp_pp/oid.h 2006-01-23 09:25:34.000000000 +0100
  @@ -438,7 +438,7 @@
     }
     smival.value.oid.len = 0;
     m_changed = true;
  -};
  +}
   
   #ifdef SNMP_PP_NAMESPACE
   }; // end of namespace Snmp_pp
  diff -Naur snmp++v3.2.20-original/src/address.cpp snmp++v3.2.20/src/address.cpp
  --- snmp++v3.2.20-original/src/address.cpp 2006-01-23 09:26:47.000000000 +0100
  +++ snmp++v3.2.20/src/address.cpp 2006-01-23 09:25:34.000000000 +0100
  @@ -765,8 +765,14 @@
       hostent lookup_buf;
   #ifdef __sun
       lookupResult = gethostbyname_r(inaddr, &lookup_buf, buf, 2048, &herrno);
  -#else
  -    gethostbyname_r(inaddr, &lookup_buf, buf, 2048, &lookupResult, &herrno);
  +    #undef SNMP_PP_IPv6
  +#else    
  +    #ifdef __QNX_NEUTRINO
  +    lookupResult = gethostbyname_r(inaddr, &lookup_buf, buf, 2048, &herrno);
  +    #undef SNMP_PP_IPv6
  +    #else    
  +    gethostbyname_r(inaddr, &lookup_buf, buf, 2048, &lookupResult, &herrno);
  +    #endif
   #endif
   #ifdef SNMP_PP_IPv6
       if (!lookupResult)
  @@ -897,8 +903,13 @@
       lookupResult = gethostbyaddr_r((char *) &ipAddr, sizeof(in_addr),
                                      AF_INET, &lookup, buf, 2048, &herrno);
   #else
  -    gethostbyaddr_r((char *) &ipAddr, sizeof(in_addr),
  + #ifdef __QNX_NEUTRINO
  +     lookupResult = gethostbyaddr_r((char *) &ipAddr, sizeof(in_addr),
  +                                   AF_INET, &lookup, buf, 2048, &herrno);
  + #else    
  +     gethostbyaddr_r((char *) &ipAddr, sizeof(in_addr),
                       AF_INET, &lookup, buf, 2048, &lookupResult, &herrno);
  + #endif     
   #endif
   #else
       lookupResult = gethostbyaddr((char *) &ipAddr, sizeof(in_addr),
  @@ -920,8 +931,13 @@
       lookupResult = gethostbyaddr_r((char *) &ipAddr, sizeof(in_addr),
                                      AF_INET6, &lookup, buf, 2048, &herrno);
   #else
  -    gethostbyaddr_r((char *) &ipAddr, sizeof(in_addr),
  +    #ifdef __QNX_NEUTRINO
  +     lookupResult = gethostbyaddr_r((char *) &ipAddr, sizeof(in_addr),
  +                                   AF_INET6, &lookup, buf, 2048, &herrno);
  +    #else    
  + gethostbyaddr_r((char *) &ipAddr, sizeof(in_addr),
                       AF_INET6, &lookup, buf, 2048, &lookupResult, &herrno);
  +    #endif
   #endif
   #else
       lookupResult = gethostbyaddr((char *) &ipAddr, sizeof(in6_addr),

  ------------------------------

  _______________________________________________
  AGENTPP mailing list
  AGENTPP at agentpp.org
  http://lists.agentpp.org/mailman/listinfo/agentpp


  End of AGENTPP Digest, Vol 24, Issue 11
  ***************************************



More information about the AGENTPP mailing list