How To Install And Configure SNMP On RHEL 7 Or CentOS 7

SNMP stands for “Simple Network Management Protocol”, it can be utilized to monitor any devices that support snmp, few of the devices are server, router, network printers, firewalls. SNMP can monitor a variety of parameters for these devices such as server performance, network usage, disk utilization.

Check Package
Check if the package is already installed, to check package installation status, run the command;

rpm -qa | grep net-snmp net-snmp-utils

Install Package
After checking the package installation status, if the package is not installed. Install the package to install run the command;

yum install net-snmp net-snmp-utils -y

Verify Installation
After installing the net-snmp packages verify if the package is installed, to check package installation status, run the command;

rpm -qa | grep net-snmp*

SNMP – Configuration File
Default configuration file that is configured as per the below. To display current configuration without comments and lines non-blank lines, run command;

grep -v "^$" /etc/snmp/snmpd.conf | grep -v '^ *#'
Default Configuration File – Snippet
com2sec notConfigUser  default       public
group   notConfigGroup v1           notConfigUser
group   notConfigGroup v2c           notConfigUser
view    systemview    included   .1.3.6.1.2.1.1
view    systemview    included   .1.3.6.1.2.1.25.1.1
access  notConfigGroup ""      any       noauth    exact  systemview none none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes

Firewall Configuration
SNMP protocol works on UDP port “161” and this port needs to be opened in order to listen and scan the report from remote servers and for latest version of snmp service supports running on TCP port which is again on “161”.
Firewall Configuration – Open UDP Port
After installing and checking the default configuration, the next step that needs to be done is to open firewall port, snmp protocol run on UDP port 161.

firewall-cmd --permanent --add-port=161/udp

Firewall Configuration – Reload
Reload the firewall configuration.

firewall-cmd --reload

Firewall Configuration – List
After reloading firewall daemon, list the current rules set.

firewall-cmd --list-alll

snmpwalk – localhost Query
After configuring the firewall, you can go ahead and test the snmp query data on the localhost it should be able to retrieve the OID values when you run. To retrieve the information run the command;

snmpwalk -v 1 -c public -O e 127.0.0.1

snmpwalk – Remote Query
To query from a remote client to retrieve the OID values when you run. To retrieve the information run the command; in this case we are querying from a windows machine.

snmpwalk -r:54.165.245.172 -q -c:public
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值