SNMP (Simple network Management Protocol) simplified Web Management Protocol
SNMP is an application-layer protocol that is part of the TCP/IP protocol family. It makes it easy to Exchange management information between network devices. Enables network administrators to manage network performance, discover and solve network problems, and expand networks.
There are three versions of SNMP Snmpv1,snmpv2,snmpv3
SNMPV1: All security mechanisms are based on communities to achieve
Notification of three mechanisms:
Read-only
Read-write
Trap
The default communities
Public: Read-only
Private: Read-write
MIB: (Management information Base) management Information base
Standard MIB Library: mib-ii
What is the MIB?
MIB is the corresponding library of device name and device number
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/71/31/wKiom1XIUo2j1FqZAAEUO2XV-JU542.jpg "title=" Qq20150810152927.png "alt=" Wkiom1xiuo2j1fqzaaeuo2xv-ju542.jpg "/>
Example: the number (OID) of an interface for each object device may be represented as shown in
Ckl.company.linuxSer1.if0
The corresponding device OID:
1.6.3.1
Device number:
OID and device establish a correspondence relationship
Objects that can be monitored:
Fault Management: Fault Management
Configuration Management: Configure management, can configure the management of Things
Accounting Management: Account Management, login user management
Performance Management: Performance management, monitoring server performance.
Security Management: Safety Management
About ports:
By default, the monitor side opens: 161 Port, UDP.
The monitor side only opens 162 ports when a trap is required, UDP
Default mid library, name corresponding OID
system:1.3.6.1.2.1.1
Defines a list of system objects, including system run time, System contact, system name
interfac:1.3.6.1.2.1.2
Define the status information of the interface, send packets, accept packets, and so on.
at:1.3.6.1.2.1.3
Defining NAT-related routing information
ip:1.3.6.1.2.1.4
Define IP-related information, IP routing, etc.
icmp:1.3.6.1.2.1.5
Defining ICMP-related information, errors, discards, etc.
tcp:1.3.6.1.2.1.6
Define TCP connection Status, Listing,establish, closed, etc.
udp:1.3.6.1.2.1.7
Defining the status of UDP
egp:1.3.6.1.2.1.4
transmission:1.3.6.1.2.1.4
snmp:1.3.6.1.2.1.4
SNMP operations
Get: Get information about a port that corresponds to a specific node
GetNext: Obtaining information for the corresponding node
Getbulk: Perhaps the information in a domain
Set: The control command will be initiated
GetResponse: Get the response information, the client came to the
Trap
Notification
Inform
Report
SNMP Installation
installed by the monitored side: net-snmp
Monitor-side installation: Net-snmp-utils, NET-SNMP (required only if trap is required)
1. Installation
# yum Install Net-snmp net-snmp-utils
2. Start the service
#/ETC/INIT.D/SNMPD Start
3. Execute command to get information
# snmpwalk-v 2c-c public localhost
-v Specifies the version number
-C Specify Communities
LocalHost Monitoring object
SNMP enabled by default two MIB libraries get information Snmpv2-mib, Host-resources-mib
To view information about a resource:
# snmpget-v 2c-c public localhost host-resources-mib::hrsystemuptime.0
4. View TCP connection status information
View information about the MIB library for TCP
#cd/usr/share/snmp/mibs
# more Tcp-mib.txt
....
TCP OBJECT IDENTIFIER:: = {mib-2 6}
....
The OID number of the MIB that is viewed to TCP is 6
Adding configuration information about TCP in the configuration file
View SystemView included. 1.3.6.1.2.1.6
Restart Service
#/ETC/INIT.D/SNMPD Restart
Viewing TCP connection Information
# snmpwalk-v 2c-c public localhost tcp
View the number of connection states
# snmpwalk-v 2c-c public localhost tcp | grep Establish | Wc-l
2
5. Modify Communities
# vi/etc/snmp/snmpd.conf
....
#com2sec notconfiguser Default Public #默认
Com2sec notconfiguser 192.168.1.0 Cklworld #修改后
Restart Service:
#/ETC/INIT.D/SNMPD Restart
Test whether the default can get information:
# snmpwalk-v 2c-c public 192.168.1.189 TCP get failed
Get information using the new communities:
# snmpwalk-v 2c-c cklworld 192.168.1.189 TCP
Snmpstatus usage:
# snmpstatus-v 2c-c Cklworld 192.168.1.189
[UDP: [192.168.1.189]:161->[0.0.0.0]]=>[linux ckl 2.6.32-504.23.4.el6.x86_64 #1 SMP Tue June 9 20:57:37 UTC 201 5 x86_64] up:1:52:35.85
interfaces:0, Recv/trans packets:0/0 | ip:0/0
This article is from the "OPS rookie" blog, please be sure to keep this source http://ckl893.blog.51cto.com/8827818/1683323
SNMP Simple description and installation