Changes between Version 1 and Version 2 of NSM2021/Agenda/SNMP-Hands-on


Ignore:
Timestamp:
May 10, 2021, 1:12:15 PM (3 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NSM2021/Agenda/SNMP-Hands-on

    v1 v2  
    136136#snmpstatus <Switch IP>
    137137}}}
     138
     139== Configuration of SNMP Agent on a Linux server ==
     140
     141We also need to monitor the servers and workstations. Here we do this by installing and configuring a SNMP agent on a server.
     142
     143Install the SNMP agent (daemon) on your host
     144
     145{{{
     146$ sudo apt install snmpd
     147$ sudo apt install libsnmp-dev
     148}}}
     149
     150Before making any changes to configurations files of a new installation it is a good practice to backup the original configuration.
     151
     152{{{
     153$ cd /etc/snmp
     154$ sudo mv snmpd.conf snmpd.conf.orig
     155$ sudo nano snmpd.conf
     156}}}
     157
     158Now enter the below configurations,
     159
     160{{{
     161#  Listen for connections on all interfaces (both IPv4 *and* IPv6)
     162agentAddress udp:161,udp6:[::1]:161
     163
     164# For SNMPv2: Configure Read-Only community and restrict who can connect
     165rocommunity <class passowrd>  192.248.6.0/24
     166rocommunity <class passowrd>  127.0.0.1
     167
     168# Information about this host
     169sysLocation    LEARN Workshop
     170sysContact     sysadm@ws.ac.lk
     171
     172# Which OSI layers are active in this host
     173# (Application + End-to-End layers)
     174sysServices    72
     175
     176# Include proprietary dskTable MIB (in addition to hrStorageTable)
     177includeAllDisks  10%
     178}}}
     179Now save and exit from the editor.
     180
     181Now 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:
     182{{{
     183$ sudo service snmpd stop
     184$ sudo net-snmp-create-v3-user -a SHA -A <class password> admin
     185$ sudo service snmpd start
     186}}}
     187
     188Check that snmpd is working:
     189{{{
     190$ snmpstatus localhost
     191}}}
     192
     193Test your neighbors
     194{{{
     195$ snmpstatus <Neighbor IP Address>
     196}}}