Net-SNMP and lm-sensors on Ubuntu 10.04

From Net-SNMP Wiki
Revision as of 04:18, 5 March 2011 by Ckmac97 (Talk | contribs)

Jump to: navigation, search
Notes

This is a Wiki tutorial for using Net-SNMP and lm-sensors on Ubuntu 10.04.1 LTS.

Source Download

You can download the latest sources of Net-SNMP from here:

  Net-SNMP Download Page

You can download the latest sources of lm-sensors from here:

  lm-sensors Download Page

Configure lm-sensors

Ubuntu 10.04.1 includes lm-sensors 3.1.2 pre-installed. To verify the lm-sensors version, type the following:

> sensors -v
sensors version 3.1.2 with libsensors version 3.1.2

lm-sensors needs to be configured using sensors-detect before it can be used. sensors-detect is an interactive script for detecting hardware sensor chips. Run the following:

> sudo sensors-detect

Following sensors-detect, reboot your system, or use the following command to load the necessary kernel modules:

> sudo /etc/init.d/module-init-tools start

To verify that lm-sensors is operating properly, use the sensors command. Example output is shown below.

> sensors
coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +36.0°C  (high = +82.0°C, crit = +100.0°C)  

coretemp-isa-0001
Adapter: ISA adapter
Core 3:      +36.0°C  (high = +82.0°C, crit = +100.0°C)  

coretemp-isa-0002
Adapter: ISA adapter
Core 1:      +36.0°C  (high = +82.0°C, crit = +100.0°C)  

coretemp-isa-0003
Adapter: ISA adapter
Core 2:      +32.0°C  (high = +82.0°C, crit = +100.0°C)  

it8718-isa-0290
Adapter: ISA adapter
in0:         +1.34 V  (min =  +0.00 V, max =  +4.08 V)   
in1:         +1.98 V  (min =  +0.00 V, max =  +4.08 V)   
in2:         +3.30 V  (min =  +0.00 V, max =  +4.08 V)   
in3:         +2.93 V  (min =  +0.00 V, max =  +4.08 V)   
in4:         +0.80 V  (min =  +0.00 V, max =  +4.08 V)   
in5:         +0.21 V  (min =  +0.14 V, max =  +0.26 V)   
in6:         +0.10 V  (min =  +0.00 V, max =  +4.08 V)   
in7:         +3.06 V  (min =  +0.00 V, max =  +4.08 V)   
Vbat:        +3.23 V
fan1:          0 RPM  (min =    0 RPM)
fan2:          0 RPM  (min =    0 RPM)
fan3:          0 RPM  (min =    0 RPM)
fan4:       1834 RPM  (min =    0 RPM)
temp1:       +37.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermistor
temp2:       +27.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermal diode
temp3:        -2.0°C  (low  = +127.0°C, high = +127.0°C)  sensor = thermistor
cpu0_vid:   +1.219 V

Install and Configure Net-SNMP

Ubuntu 10.04 does not have Net-SNMP pre-installed. To install basic Net-SNMP functionality, run the following:

> sudo apt-get install snmp
> sudo apt-get install snmpd

Several other SNMP packages are available for Ubuntu. The Ubuntu Software Center (Applications > Ubuntu Software Center) is a good resource for determining which packages are currently installed (search for "snmp").

To test that the SNMP Daemon was successfully installed, run the following:

> snmpwalk -v 2c -c public localhost system

General system information should be printed to the terminal window.

The SNMP Daemon requires additional setup. The snmpconf command is an interactive script for configuring Net-SNMP functionality (it can be used to generate snmp.conf and snmpd.conf). Run the following:

> sudo snmpconf -i -g basic_setup

NOTE: If you are unfamiliar Net-SNMP, it might be easier to create a simple snmpd.conf file manually. Using a text editor, create a file named "snmpd.conf". Add the following text:

rocommunity  public

Copy the new snmpd.conf file to the correct path (In Ubuntu, the default paths for Net-SNMP applications are slightly different):

> cp /usr/share/snmp/snmpd.conf /etc/snmp/snmpd.conf

Restart the SNMP daemon:

> /etc/init.d/snmpd restart

Test the lm-sensors MIB. The OID for the lm-sensors MIB is 1.3.6.1.4.1.2021.13.16.

> snmpwalk -v 2c -c public localhost lmSensors
> snmpwalk -v 2c -c public localhost 1.3.6.1.4.1.2021.13.16.