RHEL 7에서 Keepalived를 구성합니다. snmp를 통해서는 잘 작동합니다.
snmpwalk -v2c -cpublic 10.18.0.8 KEEPALIVED-MIB::vrrpInstanceTable
KEEPALIVED-MIB::vrrpInstanceTable = No more variables left in this MIB View (It is past the end of the MIB tree)
Keepalived 버전 및 빌드 옵션
Keepalived v1.3.5 (03/19,2017), git commit v1.3.5-6-g6fa32f2
Build options: PIPE2 LIBNL3 RTA_ENCAP RTA_EXPIRES RTA_PREF FRA_OIFNAME FRA_TUN_ID RTAX_CC_ALGO RTAX_QUICKACK LIBIPTC LIBIPSET_DYNAMIC LVS LIBIPVS_NETLINK VRRP VRRP_AUTH VRRP_VMAC SOCK_NONBLOCK SOCK_CLOEXEC FIB_ROUTING INET6_ADDR_GEN_MODE SNMP_V3_FOR_V2 SNMP SNMP_KEEPALIVED SNMP_CHECKER SNMP_RFC SNMP_RFCV2 SNMP_RFCV3 SO_MARK
SNMP 버전
NET-SNMP version: 5.7.2
연결 유지 로그:
Opening file '/etc/keepalived/keepalived.conf'.
Starting SNMP subagent
NET-SNMP version 5.7.2 AgentX subagent connected
VRRP_Instance(VI) removing protocol VIPs.
Using LinkWatch kernel netlink reflector...
VRRP sockpool: [ifindex(2), proto(112), unicast(1), fd(15,16)]
VRRP_Script(check_process) succeeded
VRRP_Instance(VI) Transition to MASTER STATE
VRRP_Instance(VI) Received advert with higher priority 109, ours 100
VRRP_Instance(VI) Entering BACKUP STATE
VRRP_Instance(VI): Sending SNMP notification
VRRP_Instance(VI) Changing effective priority from 100 to 110
/etc/snmp/snmpd.conf - 다음을 추가했습니다.
master agentx
agentXSocket /var/agentx/master
/etc/keepalived/keepalived.conf (global_defs 섹션에는...이 포함되어 있습니다.)
enable_snmp_keepalived # enable SNMP handling of vrrp element of KEEPALIVED MIB
enable_snmp_checker # enable SNMP handling of checker element of KEEPALIVED MIB
enable_snmp_rfc # enable SNMP handling of RFC2787 and RFC6527 VRRP MIBs
enable_snmp_rfcv2 # enable SNMP handling of RFC2787 VRRP MIB
enable_snmp_rfcv3 # enable SNMP handling of RFC6527 VRRP MIB
enable_traps # enable SNMP traps
나는 성공하지 못한 채 여러 기사를 살펴보았습니다. 도움이 필요하세요? 감사해요!
답변1
나는 Debian 10 Buster에서 같은 문제를 겪었고 마침내 여기에서 답을 찾았습니다.
https://unix.stackexchange.com/a/464030
분명히 기본적으로 snmpd는 다음 하위 트리에만 액세스하도록 구성되어 있습니다.
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
rocommunity public default -V systemonly
추가 등 뷰를 수정하여 다양한 방법으로 수정할 수 있습니다.
view systemonly included .1.3.6.1.4.1.9586
또는 다른 무제한 커뮤니티 등을 추가하세요.