Linux configuration Net-SNMPv3 and SNMP data retrieval

Source: Internet
Author: User
Tags md5 snmp snmpwalk iptables snmpv3

Simple Network Management Protocol (SNMP) is a standard protocol specially designed for managing network nodes (servers, workstations, routers, switches, and HUBS) in IP networks, it is an application layer protocol.
SNMP (Simple Network Management Protocol) is based on UDP port 161 and uses UDP port 162 for the management site.

Linux detailed Net-SNMPv3 configuration and SNMP data acquisition
CentOS Fedora
Yum-y install net-snmp-devel net-snmp-libs net-snmp-utils
Or
Yum install-y net-snmp *

Configure the/etc/snmp/snmpd. conf file, clear all content (in the vi editor, type dGi), and enter the following content.

Net-SNMPv2 configuration information
#192.99.12.76 is the ip address of the data collection server, and yonghumima is the snmp password (community)
Com2sec yonghuming 192.99.12.76 yonghumima
Group yonghuzu v2c yonghuming
Access yonghuzu "" any noauth prefix all none
View all supported DED. 1 80

Start the service
Chkconfig -- add snmpd; chkconfig snmpd on;
-------
Ubuntu Debian
Apt-get install snmp snmpd
Configuration file/etc/snmp/snmpd. conf

Configure Net-SNMPv3, create user password
Service snmpd stop # stop snmp first

Here we create an snmpv3 user, which is read-only and encrypted using MD5 for transmission. The user name is yonghuming and the password is yonghumima.
# Net-snmp-config -- create-snmpv3-user-ro-A yonghumima-a MD5 yonghuming
(The supplied password length is too short .)
Adding the following line to/var/lib/net-snmp/snmpd. conf:
CreateUser yonghuming MD5 "yonghumima" DES
Adding the following line to/etc/snmp/snmpd. conf:
Rouser yonghuming

Service snmpd restart
Cat/var/lib/net-snmp/snmpd. conf # file storage by account and password
...
UsmUser 1 3 0x80001f8880549a357563fd815700000000 "yonghuming" "yonghuming" NULL. 1.3.6.1.6.3.10.1.1.2 release. 1.3.6.1.6.3.10.1.2.2 release ""
...

Detect Net-SNMPv3 account password
# Snmpwalk-v 3-u yonghuming-a MD5-A "yonghumima"-l authNoPriv 127.0.0.1 sysDescr

Design a firewall to allow data to pass through
Iptables-I INPUT-p udp -- dport 161-j ACCEPT
Service iptables save; service iptables restart

Delete or modify the default password
Sed-I's @ ^ com2sec notConfigUser default public @ com2sec notConfigUser default @ '/etc/snmp/snmpd. conf # Delete the password

Restart service
Service snmpd restart

Obtain snmp data
# Snmpwalk-v 3-u yonghuming-a MD5-A "yonghumima"-l authNoPriv 122.9.44.20.sysdescr
SNMPv2-MIB: sysDescr.0 = STRING: Linux 3.10.0-327.22.2.el7.x86 _ 64 #1 SMP Thu Jun 23 17:05:11 UTC 2016 x86_64

# Snmpwalk-v 3-u yonghuming-a MD5-A "yonghumima"-l authNoPriv 122.9.44.small. 1 # retrieve all data

When the cacti device status is always unavailable, you can Create Graphs for this Host

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.