Find the answer to your Linux question:
Results 1 to 2 of 2
I'm trying to get some snmp info from my Debian Etch (testing) box. But i don't seem to get any output. Code: Etch:/# snmpget -v 1 -c public localhost system.sysUpTime.0 ...
  1. #1
    Just Joined!
    Join Date
    Jan 2007
    Posts
    2

    No SNMP output on Etch

    I'm trying to get some snmp info from my Debian Etch (testing) box. But
    i don't seem to get any output.
    Code:
    Etch:/# snmpget -v 1 -c public localhost system.sysUpTime.0 
    Error in packet 
    Reason: (noSuchName) There is no such variable name in this MIB. 
    Failed object: DISMAN-EVENT-MIB::sysUpTimeInstance
    So i tried a simple snmpwalk, but that also gives me nothing:
    Code:
    Etch:/# snmpwalk -v 1 -c public localhost 
    End of MIB
    I've verified that snmpd is listening:
    Code:
    Etch:/# netstat -natup | grep 161 
    udp        0      0 0.0.0.0:161        0.0.0.0:*        6347/snmpd
    So that seems ok.

    I've created this bare settings file in /etc/snmp/snmpd.conf
    Code:
    # /etc/snmp/snmpd.conf 
    #         sec.name  source     community 
    trapsink  readonly  localhost  public 
    #                sec.model  sec.name 
    group MyROGroup  v1         readonly 
    #           incl/excl subtree                          mask 
    view all    included  .1                               80 
    #                context sec.model sec.level match  read   write  notif 
    access MyROGroup ""      any       noauth    exact  all    none   none 
    # end of file
    And stopped en started snmpd (restart only stops snmpd, this seems like
    a bug). But still no results on snmpwalk:
    Code:
    Etch:/# snmpwalk -v 1 -c public localhost 
    End of MIB
    Any ideas where things go wrong? Or anyone that has got snmpwalk
    working on Etch?

  2. #2
    Just Joined!
    Join Date
    Jan 2007
    Posts
    2
    Ok, so after a week trying i finally got it. First off all the /etc/snmp/snmpd.conf could just simple be (dunno exactly about all the com2sec, trapsink etc keywords):
    Code:
    #       sec.name  source          community
    com2sec readonly  default         public
    #               sec.model  sec.name
    group MyROGroup v1         readonly
    #           incl/excl subtree                          mask
    view all    included  .1                               80
    view system included  .iso.org.dod.internet.mgmt.mib-2.system
    #                context sec.model sec.level match  read   write  notif
    access MyROGroup ""      any       noauth    exact  all    none   none
    And then I found the problem, it was in the command line paramters for smpd. These are 'hidden' in /etc/defaults/snmpd. I had modified these, to take out the 127.0.0.1 bit, otherwise only local snmp queries are answered. But by mistake I had also removed the - in front of smux, causing smux to be loaded which caused my problems. So, /etc/defaults/snmpd now reads:
    Code:
    # This file controls the activity of snmpd and snmptrapd
    
    # MIB directories.  /usr/share/snmp/mibs is the default, but
    # including it here avoids some strange problems.
    export MIBDIRS=/usr/share/snmp/mibs
    
    # snmpd control (yes means start daemon).
    SNMPDRUN=yes
    
    # snmpd options (use syslog, close stdin/out/err).
    SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid'
    
    # snmptrapd control (yes means start daemon).  As of net-snmp version
    # 5.0, master agentx support must be enabled in snmpd before snmptrapd
    # can be run.  See snmpd.conf(5) for how to do this.
    TRAPDRUN=no
    
    # snmptrapd options (use syslog).
    TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
    Which is nearly identical to the distributed version, expect for the removed 127.0.0.1.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •