How can we help?

How to enable SNMP on Linux-based servers & workstations

Follow

Auvik can monitor your Linux-based servers and workstations, provided we can gather data by SNMP.

A popular SNMP daemon we can run on a Linux-based workstation is Net-SNMP. This article details the installation and configuration of Net-SNMP on Debian and Red Hat-based Linux distributions. You can adapt these configuration steps to other distributions upon which Net-SNMP has been compiled.

Installing Net-SNMP on Debian-based distributions

We’ll assume the common security practice of requesting elevated rights using sudo.

$ sudo apt-get update && sudo apt-get install snmp snmpd

Net-SNMP doesn’t ship with a full set of management information bases (MIBs), so let’s install them now.

$ sudo apt-get install snmp-mibs-downloader;sudo download-mibs

Now, using your favorite text editor, edit /etc/snmp/snmp.conf to ensure mibs+ALL is uncommented and present within the file.

Next, using your text editor, edit /etc/snmp/snmpd.conf to look like this:

# this will make snmpd listen on all interfaces
agentAddress  udp:161

# a read only community 'auvik' and the source network* is defined
rocommunity auvik 172.17.1.0/16

* the source network is the subnet that the Auvik collector is sitting on 

Sources:

Installing Net-SNMP on Red Hat-based distributions

We’ll assume you have root access to the shell.

$ yum install net-snmp

Using your favourite text editor, edit /etc/snmp/snmpd.conf to make it look like so:

# this will make snmpd listen on all interfaces
agentAddress  udp:161

# a read only community 'auvik' and the source network* is defined
rocommunity auvik 172.17.1.0/16

* the source network is the network the Auvik collector is sitting on 

Restart the snmpd service: $ service snmpd restart

Configure the snmpd service to start on system startup: $ chkconfig snmpd on

Note: You may have to tweak your Linux host's firewall (typically iptables) rules to permit SNMP packet flow between your Auvik collector and your Linux host.

Testing your snmpd configuration

Test your MIBs installation by printing the hierarchical MIB tree: $ snmptranslate -Tp

Your output should look like this:

+--iso(1)
   |
   +--org(3)
      |
       +--dod(6)
         |
         +--internet(1)
            |
            +--directory(1)
            |
            +--mgmt(2)
            |  |
            |  +--mib-2(1)
            |     |
            |     +--system(1)
            |     |  |
            |     |  +-- -R-- String    sysDescr(1)
            |     |  |        Textual Convention: DisplayString
            |     |  |        Size: 0..255
...

Test your snmpd configuration by invoking a snmpwalk on the localhost: root@server:~# snmpwalk -v 2c -c myCommunity localhost

You should see verbose output like that shown below.

iso.3.6.1.2.1.1.1.0 = STRING: "Linux mrtg 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10
iso.3.6.1.2.1.1.3.0 = Timeticks: (2097) 0:00:20.97

[output truncated for example]

iso.3.6.1.2.1.92.1.1.2.0 = Gauge32: 1440
iso.3.6.1.2.1.92.1.2.1.0 = Counter32: 1
iso.3.6.1.2.1.92.1.2.2.0 = Counter32: 0
iso.3.6.1.2.1.92.1.3.1.1.2.7.100.101.102.97.117.108.116.1 = Timeticks: (1) 0:00:00.01
iso.3.6.1.2.1.92.1.3.1.1.3.7.100.101.102.97.117.108.116.1 = Hex-STRING: 07 DD 0B 12 00 39 27 00 2B 06 00

You should now have a working SNMP daemon running on your Linux servers and workstations that can communicate with Auvik to provide you with rich statistics and performance monitoring.

Was this article helpful?
8 out of 13 found this helpful
Have more questions? Submit a request