snmp SNMP

What is Snmp

Simple Network Management Protocol (SNMP) is an application layer protocol TCP / IP protocol suite. It was developed in 1988, and Internet Structure Committee (IAB) system adopted as a short-term network management solution; because of the simplicity of SNMP, in the Internet era has been vigorous development, SNMPv2 version released in 1992, in order to enhance SNMPv1 the security and functionality. Now that we have SNMPv3 version.

snmp do

SNMP (SNMP: Simple Network Management Protocol) is the Internet Engineering Task Force (IETF: Internet Engineering Task Force) set of network management protocol definition. The protocol is based on the simple gateway monitoring protocol (SGMP: Simple Gateway Monitor Protocol) . Using SNMP, a management station can remotely manage all network devices support this protocol, comprising monitoring network status, modify the network device configuration, receives network events warnings. Although SNMP is a start for IP-based network management, but as an industry standard has also been successfully used for telephone network management

Tell us about snmp

Before using the tool snmp, we must first look at the structure of snmp.
A complete system includes SNMP Management Information Base (MIB), Structure of Management Information (SMI) and SNMP message protocol.
The structure is divided into NMS and Agent

https://blog.csdn.net/shanzhizi/article/details/11606767
https://www.ibm.com/developerworks/cn/linux/l-cn-snmp/index. html

NMS network-manager-system network management system
consists of two parts based on TCP / IP Network Management: network management station (also called management process, manager) and a managed network element (also called the managed device). Tube type devices are many, for example: a router, X terminals, terminal servers and printers. These devices have in common is managed are running TCP / IP protocol. It is managed devices and associated software called proxy-related program (agent) or proxy process. Workstations are generally tinted station monitors, can display the status of all the managed devices (e.g., the connection is dropped, various traffic conditions on the connections, etc.).

MIB manager-infomation-base Management Information Base contains all the processes to all agents can be queried and modified parameter
SMI Structure of Management Information about the structure of a common symbol representing the MIB. Called the Structure of Management Information
SNMP communication protocol between the SNMP management process and proxy process Simple Network Management Protocol

protocol

Communication between the management process and proxy process there are two ways, one is to manage the process request to the proxy process, asking (get) a specific parameter value (for example, you had asked how many ICMP port unreachable) to modify (set) required to change the parameter value to the management agent process further terminal by the proxy terminal initiative to report certain content (Trap) (e.g.: an interface is down)

Request method

1) get_request (query) extracting one or more process parameter values from the agent
2) get_next_request (next query) to extract the next one or more parameters from the parameter values of the proxy process
3) set_request (modification) process of a proxy provided or more parameter values
4) get_response (acquisition request response)
5) packets trap unsolicited agent process, notification management processes have something happen.

The first four bell of these operations is a simple request-response manner, and often use UDP protocol SNMP bell, so the situation between the management process and proxy process packet loss may occur. Therefore, there must be a timeout and retransmission mechanism.

The first three operations management process issues using UDP port 161, and port 162 is taking the trp

Use snmp in Linux

installation

yum install net-snmp net-snmp-utils -y
# 查看是否安装完成
snmpd -v
snmpwalk -V

Which is net-snmp snmp software
net-snmp-utils is a tool snmp

use

Open snmp service, snmpd is a linux service, but we are snmp to operate this service by using the snmpwalk

systemctl start snmpd

The number of common snmpwalk

-h  # 显示帮助
-v  # 指定snmp的版本,1或者2或者3
-c  # 指定连接设备snmp密码。
-V  # 显示当前snmpwalk命令行版本
-r  # 指定重试次数,默认为0次
-t  # 指定每次请求的等待超时
-l  # 指定安全级别:noAuthNoPriv|authNoPriv|authPriv
-a  # 验证协议:MD5|SHA。只有-l指定为authNoPriv或authPriv时才需要
–A  # 验证字符串。只有-l指定为authNoPriv或authPriv时才需要
–x  # 加密协议:DES。只有-l指定为authPriv时才需要
–X  # 加密字符串。只有-l指定为authPriv时才需要。

Common method

snmpwalk -v 2c -c public 10.1.1.1 .1.3.6.1.2.1.25.1   # 得到取得windows端的系统进程用户数等
# 其中 -v指定版本  -c 指定密码  10.1.1.1 指定地址(localhost表示本地)  .1.3.6.1.2.1.25.1表示oid 不同的oid表示了不同的操作

Common oid

http://www.ttlsa.com/monitor/snmp-oid/

Guess you like

Origin www.cnblogs.com/Alpacapyer/p/11920542.html