Net-snmp
Jump to navigation
Jump to search
How to compile net-snmp on Ubuntu Lucid with diskio and lmsensors
Install Steps
Configure
./configure --enable-ucd-snmp-compatibility --with-mib-modules="ucd-snmp/diskio ucd-snmp/lmSensors" \ --with-default-snmp-version=2 --with-sys-location=Unknown --with-logfile=/var/log/snmpd.log
Make
make
Checkinstall
checkinstall -D --install=no --fstrans=no
Install Package
dpkg -i net-snmp...
snmpd.conf
########################################################################### # # snmpd.conf # # - created by the snmpconf configuration program # ########################################################################### # SECTION: Monitor Various Aspects of the Running Host # # The following check up on various aspects of a host. # disk: Check for disk space usage of a partition. # The agent can check the amount of available disk space, and make # sure it is above a set limit. # # disk PATH [MIN=100000] # # PATH: mount path to the disk in question. # MIN: Disks with space below this value will have the Mib's errorFlag set. # Can be a raw integer value (units of kB) or a percentage followed by the % # symbol. Default value = 100000. # # The results are reported in the dskTable section of the UCD-SNMP-MIB tree disk / 10000 disk /var/local/storage 10000 disk /var/local/backup 10000 # load: Check for unreasonable load average values. # Watch the load average levels on the machine. # # load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0] # # 1MAX: If the 1 minute load average is above this limit at query # time, the errorFlag will be set. # 5MAX: Similar, but for 5 min average. # 15MAX: Similar, but for 15 min average. # # The results are reported in the laTable section of the UCD-SNMP-MIB tree load 12 12 12 ########################################################################### # SECTION: Access Control Setup # # This section defines who is allowed to talk to your running # snmp agent. # rocommunity: a SNMPv1/SNMPv2c read-only access community name # arguments: community [default|hostname|network/bits] [oid] rocommunity AnthraX ########################################################## ##################### # Executables/scripts # # Monitoring exec scripts # mbmon -r # mbmon -f -I -c1 -T2 # TEMP0 && TEMP1 exec temp0 /usr/bin/mbmon -f -I -c1 -T1 exec temp1 /usr/bin/mbmon -f -I -c1 -T2 # FAN0 && FAN1 exec fan0 /usr/bin/mbmon -I -c1 -F1 exec fan1 /usr/bin/mbmon -I -c1 -F2
Sensors
lm_sensors package
The following is needed on IT8712 board to make "sensors" work:
/etc/default/grub GRUB_CMDLINE_LINUX="acpi_enforce_resources=lax"
Also need to compile custom module for IT8728F 1.Download kernel source
$ apt-get source linux-image-2.6.38-8-generic
2.Create test directory:
$ mkdir ~/test $ cd ~/test
3.Copy over it87.c
$ cp /home/willh/linux-2.6.38/drivers/hwmon/it87.c ./
4.Create Makefile
obj-m += it87.o all: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules clean: make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
5.To build kernel module enter:
$ make
6.(HACK)Copy new module to current kernel directory
$ cd /lib/modules/2.6.38-8-generic/kernel/drivers/hwmon $ mv it87.ko it87.ko.orig $ cp ~/test/it87.ko ./
7.Load the new module
$ modprobe -v it87 insmod /lib/modules/2.6.38-8-generic/kernel/drivers/hwmon/it87.ko
8.Test it
$ sensors acpitz-virtual-0 Adapter: Virtual device temp1: +37.0°C (crit = +127.0°C) k10temp-pci-00c3 Adapter: PCI adapter temp1: +32.8°C (high = +70.0°C) it8728-isa-0e80 Adapter: ISA adapter in0: +0.91 V (min = +3.00 V, max = +1.38 V) ALARM in1: +1.61 V (min = +2.22 V, max = +2.54 V) ALARM in2: +2.83 V (min = +0.95 V, max = +2.80 V) ALARM in3: +2.82 V (min = +0.05 V, max = +2.17 V) ALARM in4: +1.22 V (min = +1.52 V, max = +1.70 V) ALARM in5: +1.24 V (min = +0.00 V, max = +1.98 V) ALARM in6: +1.21 V (min = +0.65 V, max = +0.11 V) ALARM 3VSB: +3.31 V (min = +2.62 V, max = +4.90 V) Vbat: +3.41 V fan1: 670 RPM (min = 14 RPM) ALARM fan2: 0 RPM (min = 14 RPM) ALARM fan3: 2142 RPM (min = 16 RPM) temp1: +37.0°C (low = +47.0°C, high = +127.0°C) sensor = thermal diode temp2: -56.0°C (low = +34.0°C, high = +106.0°C) sensor = thermal diode temp3: +37.0°C (low = +6.0°C, high = +43.0°C) sensor = thermal diode cpu0_vid: +1.550 V