Announcement

Collapse
No announcement yet.

Snmp v3

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Snmp v3

    Hi,

    Does anyone have experience with building and running SNMP v3 on the XPort-Pro Linux?

    If the answer is "YES", was it strayed forward or did it need some adaptation?

    (SNMPv3 with Encryption and Authentication)

    Thanks,

    Ton.

  • #2
    Answer is Yes.
    Linux SDK contains net-snmp which can use SNMPv3.

    There are some steps for using.

    1. Modify linux/user/net-snmp/makefile

    Code:
    +++ linux/user/net-snmp/makefile
    @@ -1,8 +1,21 @@
     #
     # Makefile for net-snmp
     #
    +TOP_DIR := $(shell cd ../../; pwd)
    +include $(TOP_DIR)/config/config.make
    +
    +-include $(LINUX_CONFIG)
    +-include $(CONFIG_CONFIG)
    +
    +#CONFIG_USER_NETSNMP_BUILDSTATIC=1
    +CONFIGURE_OPTS =--host=$(GCC_HOST_TYPE) \
    +               --target=$(GCC_HOST_TYPE)
    +
    +LDFLAGS += -lpthread
    +FLTFLAGS = -s 49152
     
     CFLAGS = -D__deprecated=
    +CFLAGS += -Dfork=vfork
     
     NET_SNMP_CFG = --prefix= --disable-debugging
     
    @@ -119,6 +132,9 @@
     endif
     endif
     ifdef CONFIG_USER_NETSNMP_SNMPD
    +ifneq ($(FLTFLAGS),)
    +       $(CROSS)flthdr $(FLTFLAGS) build/agent/${NET_SNMP_EXE_DIR}snmpd
    +endif
            $(ROMFSINST) build/agent/${NET_SNMP_EXE_DIR}snmpd /bin/snmpd
     endif
     ifdef CONFIG_USER_NETSNMP_APPS_BULKGET
    2. Enable net-snmp by uClinux Distribution Configuration.

    Code:
    Network Applications
    [*] net-snmp
    [*]   Build mini agent
    [ ]   Build Applications
    [*]   Build static
    [ ]   Install scripts
    ...
    3. Build Image, and Boot target with built image

    4. Refer to linux/usr/net-snmp/build/EXAMPLE.conf, create snmp.conf with target.
    Create User for authentication. for example:
    Code:
    createUser authuser MD5 "password" DES "password"
    rouser authuser
    5. Start snmp agent (/bin/snmpd) with snmp.conf

    6. Access an agent by SNMPv3
    for example:
    Code:
    snmpwalk -c public -v3 -a MD5 -l authNoPriv -u authuser -x DES -A password <host> .1.3.6.1.2.1.1.1.0
    .1.3.6.1.2.1.1.1.0 = STRING: "uClinux uClinux 2.6.30.4-uc0 #3 Fri Jun 4 19:32:27 JST 2010 m68knommu"

    Regards,

    Comment


    • #3
      net-snmp

      Hi Tfujii,
      when check net-snmp I get some errors during compilation.

      Code:
       Network Applications
      [*] net-snmp
      [*]   Build mini agent
      [ ]   Build Applications[*]   Build static
      [ ]   Install scripts
      ...

      Code:
      [email protected]:~/programme/uc_source/linux/user/net-snmp$ make
      make -j1 xEXT=so xDIR=.libs/ -C build
      make[1]: Entering directory `/home/meloun/programme/uc_source/linux/user/net-snmp/build'
      WARNING: not running autoconf
      WARNING: not running autoheader
      making all in /home/meloun/programme/uc_source/linux/user/net-snmp/build/snmplib
      make[2]: Entering directory `/home/meloun/programme/uc_source/linux/user/net-snmp/build/snmplib'
      make[2]: Leaving directory `/home/meloun/programme/uc_source/linux/user/net-snmp/build/snmplib'
      making all in /home/meloun/programme/uc_source/linux/user/net-snmp/build/agent
      make[2]: Entering directory `/home/meloun/programme/uc_source/linux/user/net-snmp/build/agent'
      making all in /home/meloun/programme/uc_source/linux/user/net-snmp/build/agent/helpers
      make[3]: Entering directory `/home/meloun/programme/uc_source/linux/user/net-snmp/build/agent/helpers'
      make[3]: Leaving directory `/home/meloun/programme/uc_source/linux/user/net-snmp/build/agent/helpers'
      making all in /home/meloun/programme/uc_source/linux/user/net-snmp/build/agent/mibgroup
      make[3]: Entering directory `/home/meloun/programme/uc_source/linux/user/net-snmp/build/agent/mibgroup'
      make[3]: Leaving directory `/home/meloun/programme/uc_source/linux/user/net-snmp/build/agent/mibgroup'
      /bin/sh ../libtool  --mode=link ucfront-gcc m68k-uclinux-gcc -mcpu=5208 -DCONFIG_COLDFIRE -D__deprecated= -D__deprecated= -Ulinux -Dlinux=linux  -o snmpd snmpd.lo  -L../snmplib/.libs -L../snmplib -L./.libs -L./helpers/.libs -L./helpers -Wl,-elf2flt -Wl,-move-rodata -msep-data -Wl,-elf2flt -Wl,-move-rodata -msep-data  libnetsnmpagent.la helpers/libnetsnmphelpers.la libnetsnmpmibs.la ../snmplib/libnetsnmp.la  -L/home/meloun/programme/uc_source/linux/lib/zlib -L/home/meloun/programme/uc_source/linux/lib/zlib  
      ../libtool: line 46: -mcpu=5208: command not found
      libtool: link: ucfront-gcc m68k-uclinux-gcc -mcpu=5208 -DCONFIG_COLDFIRE -D__deprecated= -D__deprecated= -Ulinux -Dlinux=linux -o snmpd snmpd.o -Wl,-elf2flt -Wl,-move-rodata -msep-data -Wl,-elf2flt -Wl,-move-rodata -msep-data  -L/home/meloun/programme/uc_source/linux/user/net-snmp/build/agent/.libs -L/home/meloun/programme/uc_source/linux/user/net-snmp/build/agent/helpers/.libs -L/home/meloun/programme/uc_source/linux/user/net-snmp/build/snmplib/.libs -L/home/meloun/programme/uc_source/linux/user/net-snmp/build/snmplib -L/home/meloun/programme/uc_source/linux/user/net-snmp/build/agent/helpers ./.libs/libnetsnmpagent.a helpers/.libs/libnetsnmphelpers.a ./.libs/libnetsnmpmibs.a /home/meloun/programme/uc_source/linux/user/net-snmp/build/agent/helpers/.libs/libnetsnmphelpers.a /home/meloun/programme/uc_source/linux/user/net-snmp/build/agent/.libs/libnetsnmpagent.a /home/meloun/programme/uc_source/linux/user/net-snmp/build/snmplib/.libs/libnetsnmp.a ../snmplib/.libs/libnetsnmp.a -L/home/meloun/programme/uc_source/linux/lib/zlib
      warning: .rodata section contains relocations./.libs/libnetsnmpmibs.a(util_funcs.o): In function `net_snmp_search_update_prefix_info':
      util_funcs.c:(.text+0x10d0): undefined reference to `pthread_mutex_lock'
      util_funcs.c:(.text+0x1134): undefined reference to `pthread_mutex_unlock'
      util_funcs.c:(.text+0x1166): undefined reference to `pthread_mutex_unlock'
      util_funcs.c:(.text+0x1178): undefined reference to `pthread_mutex_lock'
      util_funcs.c:(.text+0x11dc): undefined reference to `pthread_mutex_unlock'
      util_funcs.c:(.text+0x11fc): undefined reference to `pthread_mutex_unlock'
      ./.libs/libnetsnmpmibs.a(util_funcs.o): In function `net_snmp_delete_prefix_info':
      util_funcs.c:(.text+0x122a): undefined reference to `pthread_mutex_lock'
      util_funcs.c:(.text+0x1296): undefined reference to `pthread_mutex_unlock'
      util_funcs.c:(.text+0x12bc): undefined reference to `pthread_mutex_unlock'
      collect2: ld returned 1 exit status
      make[2]: *** [snmpd] Error 1
      make[2]: Leaving directory `/home/meloun/programme/uc_source/linux/user/net-snmp/build/agent'
      make[1]: *** [subdirs] Error 1
      make[1]: Leaving directory `/home/meloun/programme/uc_source/linux/user/net-snmp/build'
      make: *** [all] Error 2
      What did I wrong?
      Last edited by meloun; 12-07-2010, 12:54 PM.

      Comment

      Working...
      X