SNMP: Simple Network Management Protocol
SNMP is used for monitoring of network devices, collects logs and health statistics of different device nodes. SNMP data can be collected on a centralized NMS (Network Management System), the collected data can be plotted for a better representation of the overall network health. SNMP collects all of its data via SNMP Pooling and SNMP traps. Some famous SNMP supported NMSs are IBM Tivoli, PRTG and MRTG grapher. Many free SNMP based software is also available in the open source community.
Quick Facts about SNMP:
- SNMP Poll uses UDP 161
- SNMP Trap uses UDP 162
- SNMPv3 allows username authentication and packet encryption
- SNMP Inform requires packet acknowledgement, while SNMP Trap does not
- SNMP versions: SNMPv1, SNMPv2c & SNMPv3
SNMP MIB (management information base) : SNMP MIB specifies all the elements that can be managed via our NMS or network monitoring tool.
SNMP Configuration in GNS3
Suppose, we are setting in a NOC (Network Operations Center). Our network is up and running, our task is to configure an SNMP based NMS to monitor our Core Network Router (R1), which is critical for our network operations. We are using a very popular NMS, known as PRTG (Packet router traffic Grapher). PRTG is a very popular used NMS, very good, efficient and excellent graphical interface, which gives us a very remarkable view of our critical network elements.
The simple flow of the topology is as follows:
A 2691 router is connected to a cloud (in GNS3, Cloud is used to connect the router to our PC physical interface). PRTG NMS has been configured on PC1 (local host). The topology is given below:
The IPs used:
- Fast Ethernet 0/0 ( R1) : 192.168.0.99/24
- NMS PC1 IP : 192.168.0.100/24
SNMP enabled via the following commands on R1:
We need to configure a community string (community string is a sort of snmp password) for our snmp server on the router, in our case as we are using community string “PRTG” (using PRTG as the community string for simplicity):
snmp-server community PRTG RW
Above command, simply means that we have enabled PRTG as a password for our snmp-server. You need to use this password while configuring the SNMP settings on your NMS, in our case its PRTG. In the next step we are going to set our SNMP server host address:
R1 (Config)#snmp-server host ? (Hostname or IP/IPV6 address of SNMP notification host HTTP address of XML notification host)
http://<Hostname or A.B.C.D>[:<port number>][/<uri>]
Host means our SNMP server IP address, in our case it is: 192.168.0.101/24.
And you can also select which version of SNMP you want to use by:
R1 (config) # snmp-server host 192.168.0.101 version ?
1 use snmpv1
2c use snmpv2c
3 use snmpv3
We have done our configuration on PRTG server and have enabled the monitoring of Fast Ethernet 0/0 interface of R1. The NMS output can be shown as:
In the above example we have configured our NMS to monitor R1 Health and R1 Fast Ethernet 0/0 interface status. The sample outputs from NMS are:
Some more amazing graphs:
All the logs related to our above simple network are maintained:
To check SNMP in action, we can use: debug snmp packets command. The sample debug output for above network is:
SNMP is the most interesting topic to study and configure, you can download many propriety and open source SNMP based NMS tools from internet to experiment with.