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
または他の無制限のコミュニティなどを追加してください。