SNMP exercises, part 1 SANOG 10 1. Getting packages # apt-get install snmp # apt-get install snmpd # apt-get install mbrowse 2. GET and WALK To control that your SNMP installation works: - The backbone router: # snmpstatus -c san0g -v1 169.223.1.1 - The classroom switch: # snmpstatus -c san0g -v1 169.223.5.253 - Try to snmpwalk different parts of these equipments' MIBs: # snmpwalk -c san0g -v1 169.223.1.1 1.3.6.1.4.1.9.9.13.1.3 | more # ... Do you notice anything important about the OID on the output ? 3. Configuration of snmpd - Edit the following file: # vi /etc/snmp/snmpd.conf Comment the line (ADD '#' in front): com2sec paranoid default public And UNcomment the line (REMOVE the '#' in front): #com2sec readonly default public Edit the file /etc/default/snmpd, and find the line: SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1' Remove 127.0.0.1 at the end, so you have: SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid' - Restart snmpd # /etc/init.d/snmpd stop # /etc/init.d/snmpd start 4. Check that snmpd is working: # snmpstatus -c public -v1 localhost - What do you observe ? 5. Check now that you can run snmpstatus against your neighbor's server: - Find out what your neighbor's IP is, ask them to run: # ifconfig eth0 (your IP is 169.223.5.X where X is between 10-24) - Check snmp against their machine: # snmpstatus -c public -v1 169.223.5.X 6. Adding MIBs Remember when you ran: # snmpwalk -c san0g -v1 169.223.1.1 1.3.6.1.4.1.9.9.13.1.3 | more If you noticed, the SNMP client (snmpwalk) couldn't interpret all the OIDs coming back from the Agent: SNMPv2-SMI::enterprises.9.9.13.1.3.1.3.1 = Gauge32: 27 SNMPv2-SMI::enterprises.9.9.13.1.3.1.3.2 = Gauge32: 41 SNMPv2-SMI::enterprises.9.9.13.1.3.1.3.3 = Gauge32: 26 What is '9.9.13.1.3.1.3' ? To be able to interpret this information, we need to download extra mibs... - Download the following files to your machine: # cd /usr/share/snmp/mibs # wget ftp://ftp.cisco.com/pub/mibs/v2/CISCO-SMI.my # wget ftp://ftp.cisco.com/pub/mibs/v2/CISCO-ENVMON-MIB.my - Create the file /usr/share/snmp/snmp.conf, and put into it: mibdirs /usr/share/snmp/mibs mibs ALL Save the file, quit. Now, try again: # snmpwalk -c san0g -v1 169.223.5.253 1.3.6.1.4.1.9.9.13.1.3 | more