[Pacemaker] [PATCH] SNMP for net-snmp5.3

Simon Horman horms at verge.net.au
Wed Mar 10 07:47:06 UTC 2010


On Wed, Mar 10, 2010 at 02:57:12PM +0900, sato yuki wrote:
> Hello all.
> 
> This patch is thing to snmp version of net-snmp-5.3.
> I want to for the RHEL5 default version.
> 
> How about this patch?

This looks reasonable to me.

> diff -r 5e66e2b7b953 configure.ac
> --- a/configure.ac	Tue Mar 09 15:08:00 2010 +0100
> +++ b/configure.ac	Wed Mar 10 14:53:31 2010 +0900
> @@ -1105,7 +1105,12 @@
>        LIBS="$LIBS $SNMPLIBS"
>        AC_CHECK_FUNCS(netsnmp_transport_open_client)
>        if test $ac_cv_func_netsnmp_transport_open_client != yes; then
> -      	 SUPPORT_SNMP=no
> +         AC_CHECK_FUNCS(netsnmp_tdomain_transport)
> +         if test $ac_cv_func_netsnmp_tdomain_transport != yes; then
> +            SUPPORT_SNMP=no
> +         fi
> +      else
> +         AC_DEFINE_UNQUOTED([NETSNMPV54], $NETSNMP_NEW_SUPPORT, [have net-snmp5.4 over])
>        fi
>        LIBS=$savedLibs
>     fi
> diff -r 5e66e2b7b953 tools/crm_mon.c
> --- a/tools/crm_mon.c	Tue Mar 09 15:08:00 2010 +0100
> +++ b/tools/crm_mon.c	Wed Mar 10 14:53:31 2010 +0900
> @@ -1194,6 +1194,10 @@
>  static netsnmp_session *crm_snmp_init(const char *target) 
>  {
>      static netsnmp_session *session = NULL;
> +#ifndef NETSNMPV54
> +	char default_port[128];
> +	snprintf(default_port,sizeof(default_port),"%s:162",target);
> +#endif
>  
>      if(session) {
>  	return session;
> @@ -1216,7 +1220,11 @@
>      session->callback_magic = NULL;
>  
>      session = snmp_add(session,
> +#ifdef NETSNMPV54
>                    netsnmp_transport_open_client("snmptrap", target),
> +#else
> +                  netsnmp_tdomain_transport(default_port, 0, "udp"),
> +#endif
>                    NULL, NULL);
>  
>      if (session == NULL) {

> _______________________________________________
> Pacemaker mailing list
> Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker





More information about the Pacemaker mailing list