Changes between Version 7 and Version 8 of netmon2017snmp


Ignore:
Timestamp:
Nov 12, 2017, 5:47:31 PM (7 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • netmon2017snmp

    v7 v8  
    167167}}}
    168168
    169 === Configure SNMP on Your Router/Switch (Already Done) ===
     169=== Configure SNMP on Your !Router/Switch (Already Done) ===
    170170
    171171connect to your router and go to configure mode.
     
    217217
    218218example :
     219
     220=== Configuration of snmpd on your PC ===
     221
     222For this exercise your group needs to verify that the snmpd service is running and responding to queries for all machines in your group. First enable snmpd on your machine, then test if your machine is responding, then check each machine of your other group members.
     223
     224Install the SNMP agent (daemon)
     225{{{
     226$ sudo apt-get install snmpd
     227$ sudo apt-get install libsnmp-dev
     228}}}
     229==== Configuration ====
     230
     231We will make a backup of the distributed config, and then we will create our own:
     232{{{
     233$ cd /etc/snmp
     234$ sudo mv snmpd.conf snmpd.conf.dist
     235$ sudo editor snmpd.conf
     236}}}
     237
     238Then, copy/paste the following (change pcX to your own pc number):
     239{{{
     240#  Listen for connections on all interfaces (both IPv4 *and* IPv6)
     241agentAddress udp:161,udp6:[::1]:161
     242
     243# For SNMPv2: Configure Read-Only community and restrict who can connect
     244rocommunity NetManage  10.10.0.0/16
     245rocommunity NetManage  127.0.0.1
     246
     247# Information about this host
     248sysLocation    NSRC Network Management Workshop
     249sysContact     sysadm@pcX.ws.nsrc.org
     250
     251# Which OSI layers are active in this host
     252# (Application + End-to-End layers)
     253sysServices    72
     254
     255# Include proprietary dskTable MIB (in addition to hrStorageTable)
     256includeAllDisks  10%
     257}}}
     258Now save and exit from the editor.
     259
     260Now we will add the same SNMPv3 user to your PC. We need to stop snmpd before adding the user, and restart it to read the above changes as well as the new user:
     261{{{
     262$ sudo service snmpd stop
     263$ sudo net-snmp-create-v3-user -a SHA -A <class password> admin
     264$ sudo service snmpd start
     265}}}
     266
     267Check that snmpd is working:
     268{{{
     269$ snmpstatus localhost
     270}}}
     271
     272Test your neighbors
     273{{{
     274$ snmpstatus <Neighbor IP Address>
     275}}}
     276
     277=== Adding MIBs ===
     278
     279Remember when you ran:
     280
     281$ snmpwalk <IP Address> .1.3.6.1.4.1.9.9.13.1
     282If you noticed, the SNMP client (snmpwalk) couldn't interpret all the OIDs coming back from the Agent:
     283
     284SNMPv2-SMI::enterprises.9.9.13.1.3.1.2.1 = STRING: "chassis"
     285SNMPv2-SMI::enterprises.9.9.13.1.3.1.6.1 = INTEGER: 1
     286What is 9.9.13.1.3.1 ?
     287
     288To be able to interpret this information, we need to download extra MIBs:
     289
     290Download them now as follows:
     291{{{
     292$ cd /usr/share/mibs
     293$ sudo mkdir cisco
     294$ cd cisco
     295
     296$ sudo wget http://www.ws.nsrc.org/downloads/mibs/CISCO-SMI.my
     297$ sudo wget http://www.ws.nsrc.org/downloads/mibs/CISCO-ENVMON-MIB.my
     298}}}
     299
     300Now we need to tell the snmp tools that we have the cisco MIBS it should load. So edit the file /etc/snmp/snmp.conf, and add the following two lines:
     301{{{
     302mibdirs +/usr/share/mibs/cisco
     303mibs +CISCO-ENVMON-MIB:CISCO-SMI
     304}}}
     305Save the file, quit.
     306
     307Now, try again:
     308
     309$ snmpwalk <IP Address>  .1.3.6.1.4.1.9.9.13.1