------------------------------------------------------------------------ SNMP LAB EXERCISES ------------------------------------------------------------------------ The goal of this exercise is to become familiar with the net-snmp tools, as well as the operation of SNMP. You will enable an snmpd agent on your workstation. You will then use SNMP tools to query the agent. These tools include: snmpstatus, snmpget, and snmpwalk, and snmptranslate. You will see some of the common MIB categories. And at the end, you will examine the MIB files to see where they are located, and what kind of information they contain. ------------------------------------------------------------------------- 1. Install net-snmp % cd /usr/ports/net-mgmt/net-snmp % sudo # make # make install * YOU MAY WANT TO TYPE REHASH NOW! * # rehash 2. Add to the startup file # vi /etc/rc.conf snmpd_enable="YES" snmpd_flags="-a" snmpd_conffile="/usr/local/share/snmp/snmpd.config" snmptrapd_enable="YES" snmptrapd_flags="-a -p /var/run/snmptrapd.pid" 3. Configure the local snmpd.conf # vi /usr/local/share/snmp/snmpd.config rocommunity afnog 196.200.208.0/20 rocommunity afnog 127.0.0.1 sysLocation where-is-this-machine-located sysContact your-name-and-e-mail-here sysDescr describe-system-here disk / disk /var load 12 10 5 4. Start the snmpd # /usr/local/etc/rc.d/snmpd start 5. Test to see if it your local SNMPD is responding You can leave root now if you want to… # exit * YOU MAY WANT TO TYPE REHASH NOW * % rehash % snmpstatus -v 2c -c afnog localhost 6. Walk through the "system" MIB section: % snmpwalk -v 2c -c afnog localhost system 7. What type of data is in these MIBs? % snmptranslate .1.3.6.1.2.1.2.2.1.2 % snmptranslate .1.3.6.1.2.1.31.1.1.1.18 % snmptranslate .1.3.6.1.2.1.25.2.3.1 % snmptranslate .1.3.6.1.2.1.25.4.2.1 8. Walk through the "interfaces" iftable MIB section: % snmpwalk -v 2c -c afnog localhost iftable 9. Do the same thing but with "ifXtable": % snmpwalk -v 2c -c afnog localhost ifXtable 10. Walk through your neighbors "interfaces": NOTE: Look for what is different here % snmpwalk -v 2c -c afnog pcXX interfaces 11. Where are your MIBs? % cd /usr/local/share/snmp/mibs 12. What kinds of things are in the MIBS files for: % less HOST-RESOURCES-MIB.txt % less IF-MIB.txt --- END