Showing entries with tag "SNMP".

Found 3 entries

Basic snmpd.conf file to monitor ethernet ports of a Linux box

I need to monitor the Ethernet interfaces of a Linux VM. This is the perfect job for snmpd which you can get by installing net-snmp and then applying a basic config. Here is a simplified config that will get you basic read-only access for a community and subnet.

# /etc/snmp/snmpd.conf
rocommunity snmp-read 165.92.231.0/24
rocommunity snmp-read 10.3.1.0/24
rocommunity snmp-read localhost
syslocation "City, State"
syscontact  "Admin <user@domain.com>"

You can test your new SNMP configuration with snmpwalk

snmpwalk -v 2c -c snmp-read 127.0.0.1
Leave A Reply

Disabling an ethernet port via SNMP

Interacting with ethernet ports on an SNMP device is done primarily with two sections of the SNMP tree. IF-MIB::ifOperStatus is the current layer 1 status of the port (i.e. is the port linked or not) and IF-MIB::ifAdminStatus is whether the port is administratively shutdown.

If you want to shutdown an ethernet port on an SNMP enabled device you need to set IF-MIB::ifAdminStatus to integer 2 (down), and conversely setting it to integer 1 (up) will enable the port again.

snmpset -v 2c -c community 192.168.5.1 IF-MIB::ifAdminStatus.5 i 2
Leave A Reply

Cisco: Monitor temperature via SNMP

I need to monitor the temperature of some Cisco equipment via SNMP. Using this guide as a reference I was able configure Nagios to monitor the ambient (inlet) temperature in our data center.

First you'll need to find the sensor's ID number based on the description here:

snmpwalk -v 2c -On -c public router.domain.com .1.3.6.1.2.1.47.1.1.1.1.2

You should get a long list of various parts of your router. The last section of the OID is the ID of that particular sensor. Usually they are in the thousands. After that you look at another section of the SNMP tree to gather the actual temperature:

snmpget -v 2c -On -c public router.domain.com .1.3.6.1.4.1.9.9.91.1.1.1.1.4.XXXX

or view all of the sensors:

snmpwalk -v 2c -On -c public router.domain.com .1.3.6.1.4.1.9.9.91.1.1.1.1.4
Leave A Reply