Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure SNMP in Linux system

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Linux system how to configure SNMP, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Configure SNMP on Debian or Ubuntu

To install the SNMP Agent (snmpd) on a Debian-based system, run the following command:

The code is as follows:

Root@server:~# apt-get install snmpd

Then, edit the configuration file as follows.

The code is as follows:

Root@server:~# vim / etc/snmp/snmpd.conf

# make snmpd snooping on all interfaces

AgentAddress udp:161

# define a read-only community 'myCommunity' and source network

Rocommunity myCommunity 172.17.1.0/24

SysLocation Earth

SysContact email@domain.tld

After editing the configuration file, restart snmpd.

The code is as follows:

Root@server:~# service snmpd restart

Configure SNMP on CentOS or RHEL

To install the SNMP tools and libraries, run the following command.

The code is as follows:

Root@server:~# sudo yum install net-snmp

Then, edit the SNMP configuration file as follows.

The code is as follows:

Root@server:~# vim / etc/snmp/snmpd.conf

# define a user 'myUser' using community' myCommunity' and source network 172.17.1.0 Universe 24

Com2sec myUser 172.17.1.0/24 myCommunity

# add myUser to the 'myGroup' group to define group permissions

Group myGroup v1 myUser

Group myGroup v2c myUser

View all included. 1

Access myGroup "" any noauth exact all all none

Root@server:~# service snmpd restart

Root@server:~# chkconfig snmpd on

Restart the snmpd service and add it to the startup services list.

Test SNMP

SNMP can be tested by running the snmpwalk command. If SNMP has been successfully configured, this command produces a large amount of output.

The code is as follows:

Root@server:~# snmpwalk-c myCommunity 172.17.1.44-v1

Iso.3.6.1.2.1.1.1.0 = STRING: "Linux mrtg 3.5.0-17-generic # 28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86 * 64"

Iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10

Iso.3.6.1.2.1.1.3.0 = Timeticks: (2097) 0VOUL00RU 20.97

~ ~ output truncation ~ ~

Iso.3.6.1.2.1.92.1.1.2.0 = Gauge32: 1440

Iso.3.6.1.2.1.92.1.2.1.0 = Counter32: 1

Iso.3.6.1.2.1.92.1.2.2.0 = Counter32: 0

Iso.3.6.1.2.1.92.1.3.1.1.2.7.100.101.102.97.117.108.116.1 = Timeticks: (1) 0VOUGOO 00.01

Iso.3.6.1.2.1.92.1.3.1.1.3.7.100.101.102.97.117.108.116.1 = Hex-STRING: 07 DD 0B 12 00 39 27 00 2B 06 00

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report