Announcement

Collapse
No announcement yet.

SNMP Memory Leak (Extend, Exec)

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

  • SNMP Memory Leak (Extend, Exec)

    After building snmp and starting the daemon on Xport Pro Linux the snmpd process will grow exponentially over several hours (in 4 kilobyte incrementes) and crash the Xport when using net-snmp-extend-mib or exec.

    To duplicate add to your snmpd.conf file these simple lines:

    Code:
    exec AmbientTemp_READ /bin/echo 80
    exec AmbientRH_READ /bin/echo 25
    SNMPWALK, SNMPGET

    Code:
    #SNMPWALK
    snmpwalk -v2c -c communitystring 172.31.1.117 .1.3.6.1.4.1.2021.8.1
    UCD-SNMP-MIB::extIndex.1 = INTEGER: 1
    UCD-SNMP-MIB::extNames.1 = STRING: AmbientTemp_READ
    UCD-SNMP-MIB::extCommand.1 = STRING: /bin/echo
    UCD-SNMP-MIB::extResult.1 = INTEGER: 0
    UCD-SNMP-MIB::extOutput.1 = STRING: 80
    UCD-SNMP-MIB::extErrFix.1 = INTEGER: noError(0)
    UCD-SNMP-MIB::extErrFixCmd.1 = STRING:
    
    #GET REQUEST
    snmpget -v2c -c communitystring 172.31.1.117 .1.3.6.1.4.1.2021.8.1.101.1
    UCD-SNMP-MIB::extOutput.1 = STRING: 80
    
    snmpget -v 2c -c communitystring 172.31.1.117 .1.3.6.1.4.1.2021.8.1.101.2
    UCD-SNMP-MIB::extOutput.2 = STRING: 25
    Set your snmp NMS software to get the *.*.101.1 and *.*.101.2 OIDs.

    Or use a batch or other script running snmpget in loop such as this:

    Code:
    REM SNMP Memory Test SCRIPT
    
    :start
    REM Ambient Temp (Extend)
    snmpget -v 2c -c communitystring 172.31.1.117 .1.3.6.1.4.1.2021.8.1.101.1
    
    REM Ambient RH (Extend)
    snmpget -v 2c -c communitystring 172.31.1.117 .1.3.6.1.4.1.2021.8.1.101.2
    
    sleep 2
    goto start
    After a while the Xport will become unresponsive, further queries will eventually fail as no memory was released.
    Last edited by techadmin; 05-20-2011, 01:12 PM.

  • #2
    s2e Resource Leak

    Stopping the s2e process seams to resolve the memory leak issue, though I'm still testing..

    FYI - I ran cppcheck (code analysis tool) against the s2e directory in the SDK and found the following, maybe a contributor:

    cppcheck --enable=all *.c

    Checking sys_conf.c...
    [s2e_conf.c:1235]: (error) Resource leak: fp
    [s2e_conf.c:1361]: (error) Resource leak: fp

    Checking s2e_common.c...
    [s2e_common.c:404]: (possible error) Dangerous usage of strncat. Tip: the 3rd

    parameter means maximum number of characters to append
    [s2e_common.c:181]: (error) Resource leak: fd

    Comment


    • #3
      Net-SNMP 5.6.1

      Also, a quick note, I have replaced the Net-SNMP 5.5 version with 5.6.1 by backing up the existing net-snmp directory, replacing it with 5.6.1, renamed net-snmp, build net-snmp using net-snmp instructions, run sdk make file, make will fail, create openssl directory in build/snmplib, then run make again and it will succeed.

      Comment


      • #4
        Help installing snmpget, snmpset and snmpwalk

        Originally posted by techadmin View Post
        After building snmp and starting the daemon on Xport Pro Linux the snmpd process will grow exponentially over several hours (in 4 kilobyte incrementes) and crash the Xport when using net-snmp-extend-mib or exec.

        To duplicate add to your snmpd.conf file these simple lines:

        Code:
        exec AmbientTemp_READ /bin/echo 80
        exec AmbientRH_READ /bin/echo 25
        SNMPWALK, SNMPGET

        Code:
        #SNMPWALK
        snmpwalk -v2c -c communitystring 172.31.1.117 .1.3.6.1.4.1.2021.8.1
        UCD-SNMP-MIB::extIndex.1 = INTEGER: 1
        UCD-SNMP-MIB::extNames.1 = STRING: AmbientTemp_READ
        UCD-SNMP-MIB::extCommand.1 = STRING: /bin/echo
        UCD-SNMP-MIB::extResult.1 = INTEGER: 0
        UCD-SNMP-MIB::extOutput.1 = STRING: 80
        UCD-SNMP-MIB::extErrFix.1 = INTEGER: noError(0)
        UCD-SNMP-MIB::extErrFixCmd.1 = STRING:
        
        #GET REQUEST
        snmpget -v2c -c communitystring 172.31.1.117 .1.3.6.1.4.1.2021.8.1.101.1
        UCD-SNMP-MIB::extOutput.1 = STRING: 80
        
        snmpget -v 2c -c communitystring 172.31.1.117 .1.3.6.1.4.1.2021.8.1.101.2
        UCD-SNMP-MIB::extOutput.2 = STRING: 25
        Set your snmp NMS software to get the *.*.101.1 and *.*.101.2 OIDs.

        Or use a batch or other script running snmpget in loop such as this:

        Code:
        REM SNMP Memory Test SCRIPT
        
        :start
        REM Ambient Temp (Extend)
        snmpget -v 2c -c communitystring 172.31.1.117 .1.3.6.1.4.1.2021.8.1.101.1
        
        REM Ambient RH (Extend)
        snmpget -v 2c -c communitystring 172.31.1.117 .1.3.6.1.4.1.2021.8.1.101.2
        
        sleep 2
        goto start
        After a while the Xport will become unresponsive, further queries will eventually fail as no memory was released.

        Hi all!

        I am wondering about the possibility of using an XportPro as a SNMP manager to monitor the status of another XPortPro.

        Im able to include snmpget, snmpset and snmpwalk applications from the make menuconfig menu but when using them I always get:

        No log handling enabled - using stderr logging
        snmpget: (null)

        And many times my XPORT PRO gets unresponsive even when restarting and I have to reflash the unit

        I wonder if I have to include any MIB or bluid the miniagent in the configuration wizard, note that I only want to get information about the other XPort not from mine.

        Some help using the make menuconfig options properly?


        I wrote a post with the same question but later I found this post and I think that you could help me as I see you are using the commands I need.[/B]

        My configuration procedure is as follows:

        1 .- make menu config
        2.- set default all settings (lose changes) exit and save.
        The assitstant ask to include my own apps and I say ‘N’ so that none of my programs will be included in the image
        3.- make menuconfig->customize Application/Library Settings (NEW)->exit-> exit-> save new kernel configuration
        4.- Network Applications:
        select net-snmp 5.6.1
        Build mini agent
        Build applications -> snmpget, snmpset,snmpwalk
        Install mibs, enable mib loading
        No additional mibs
        5.- exit->exit-> save new kernel configuration

        6.- Compile the image with no errors
        7.- upload to my unit
        8.- Testing with the results of my support request

        Is there any wrong step in my workflow?




        Thanks in advance I hope someone could help me.
        Last edited by JTORRES; 04-26-2016, 10:43 AM.

        Comment

        Working...
        X