重庆思庄Oracle、Redhat认证学习论坛

标题: linux7版本启动snmp服务并开放udp端口 [打印本页]

作者: mahan    时间: 2024-4-7 18:58
标题: linux7版本启动snmp服务并开放udp端口

[root@hm-server1 snmp]# vi /etc/snmp/snmpd.conf
####
# First, map the community name "public" into a "security name"

#       sec.name  source          community
com2sec notConfigUser  default       chcmu-admin

####
# Second, map the security name into a group name:

#       groupName      securityModel securityName
group   notConfigGroup v1           notConfigUser
group   notConfigGroup v2c           notConfigUser

####
# Third, create a view for us to let the group have rights to:

# Make at least  snmpwalk -v 1 localhost -c public system fast again.
#       name           incl/excl     subtree         mask(optional)
view    systemview    included   .1.3.6.1.2.1.1
view    systemview    included   .1.3.6.1.2.1.25.1.1

view    systemview    included   .1

[root@hm-server1 snmp]# systemctl restart snmpd
[root@hm-server1 snmp]#
[root@hm-server1 snmp]#
[root@hm-server1 snmp]#
[root@hm-server1 snmp]# systemctl status snmpd
бё snmpd.service - Simple Network Management Protocol (SNMP) Daemon.
   Loaded: loaded (/usr/lib/systemd/system/snmpd.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2024-01-19 09:31:27 CST; 9s ago
Main PID: 307144 (snmpd)
    Tasks: 1
   Memory: 4.3M
   CGroup: /system.slice/snmpd.service
           й╕йд307144 /usr/sbin/snmpd -LS0-6d -f

Jan 19 09:31:27 hm-server1 systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon....
Jan 19 09:31:27 hm-server1 snmpd[307144]: NET-SNMP version 5.7.2
Jan 19 09:31:27 hm-server1 systemd[1]: Started Simple Network Management Protocol (SNMP) Daemon..

开放端口
linux7:
firewall-cmd --zone=public --add-port=161/udp --permanent

linux6:
iptables -I INPUT -p udp --dport 161 -j ACCEPT






欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2