Gl.ib.ly

(glibly); Just another techie blog.

Installing SNMPD (with remote access) on Debian 5/Lenny

Posted by Tariq • Wednesday, March 10. 2010 • Category: Tidbits
Today we're installing snmpd so that we can query our debian server from another remote server that will use snmp in alert scripts and pretty graphing software.

Snmpd installation is a little obtuse so here is how to do the installation on Debian Lenny.


  • Install snmpd with: sudo apt-get install snmpd

  • You should be using RCS/git/etc when editing system files at work. So use the appropriate techniques for checking in and out all config files. If you're a home user don't worry about this step; or, maybe you should. Muhahahaha! Eh, *cough*.

  • Open /etc/snmp/snmpd.conf and change to the following:
    # sec.name source community
    #com2sec paranoid default public
    #com2sec local localhost public
    com2sec local localhost mysecretcommunity
    com2sec readonly 192.168.XXX.XXX mysecretcommunity
    #com2sec readwrite default private


    Here mysecretcommunity is the uber secret name of your community. Change this to something other than public or mycommunity -- let common sense prevail. 192.168.XXX.XXX is the IP address of your remote server that will query snmpd.

  • Change /etc/default/snmpd so that it contains the following line:
    SNMPDOPTS=’-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid’ 

    Notice the lack of 127.0.0.1?

  • Save the file!

  • Restart snmpd with sudo /etc/init.d/snmpd restart.

  • Test snmpd locally:
    snmpwalk -Os -c mysecretcommunity -v 1 localhost system

  • Test snmpd remotely from 192.168.XXX.XXX:
    snmpwalk -Os -c mysecretcommunity -v 1 192.168.YYY.YYY system 


    Here 192.168.YYY.YYY is the IP address of the debian server hosting snmpd.

  • Verify test outputs look like:
    ...
    sysObjectID.0 = OID: netSnmpAgentOIDs.10
    sysUpTimeInstance = Timeticks: (1201) 0:00:12.01
    sysContact.0 = STRING: root
    sysName.0 = STRING: irsplsemos01
    sysLocation.0 = STRING: Unknown
    sysORLastChange.0 = Timeticks: (0) 0:00:00.00
    sysORID.1 = OID: snmpFrameworkMIBCompliance
    sysORID.2 = OID: snmpMPDCompliance
    sysORID.3 = OID: usmMIBCompliance
    sysORID.4 = OID: snmpMIB
    sysORID.5 = OID: tcpMIB
    sysORID.6 = OID: ip
    sysORID.7 = OID: udpMIB
    sysORID.8 = OID: vacmBasicGroup
    ...


  • Thats all folks!

    Defined tags for this entry: , , , , ,
    Vote for articles fresher than 90 days!
Bookmark Installing SNMPD (with remote access) on Debian 5/Lenny   at del.icio.us Digg Installing SNMPD (with remote access) on Debian 5/Lenny  Bloglines Installing SNMPD (with remote access) on Debian 5/Lenny  Technorati Installing SNMPD (with remote access) on Debian 5/Lenny  Fark this: Installing SNMPD (with remote access) on Debian 5/Lenny  Bookmark Installing SNMPD (with remote access) on Debian 5/Lenny   at YahooMyWeb Bookmark Installing SNMPD (with remote access) on Debian 5/Lenny   at Furl.net Bookmark Installing SNMPD (with remote access) on Debian 5/Lenny   at blogmarks Stumble It!

0 Comments

Display comments as (Linear | Threaded)
  1. No comments

Add Comment


Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

You can use [geshi lang=lang_name [,ln={y|n}]][/geshi] tags to embed source code snippets.