今回は
「Zabbixを現行で使っているが、新規で入れるものも一緒に監視したい。
だがSNMPv3で行けるのか?」
といった案件が来たので、検証してみました。
書いていると思った以上に長くなったので、本件は3部に分けて作成します。
① ESXi側の設定
↑こんかいはここ
② Zabbix側の設定
③ テスト、はまったところ
検証環境
〇Zabbix Server
・Zabbix 5.4.12
〇監視対象
・ESXi 7.0.3 (Nested環境)
ESXi側のSNMP設定
ESXi側で行う設定は大まかに分けて4段階になります。
・エージェントの識別子として機能するSNMPを構成
・SNMPv3受信先への送信設定
以下のコマンドを入力し、現在のSNMP設定を確認します。
[root@locaohost:~] esxcli system snmp get
Authentication:
Communities: public
Enable: false
Engineid: 80001ADC0520353221431672030414
Hwsrc: indications
Largestorage: true
Loglevel: warning
Notraps:
Port: 161
Privacy:
Remoteusers:
Syscontact:
Syslocation:
Targets:
Users:
V3targets:
SNMPエンジンIDの設定
10桁の16進数を入力します。(決まりはないので、好きに設定してOK)
[root@locaohost:~] esxcli system snmp set --engineid xxxxxxxxxx
SNMPv3 認証とプライバシーの構成
最初に以下のコマンドを実行します。
次に以下のコマンドを実行します。
[root@locaohost:~] esxcli system snmp set --privacy = AES128
authenticationは ”SHA1”または”MD5”
privacyは ”none”または”AES128”になります。
Zabbix側での登録時に使用するので、覚えておいてください。
SNMPv3 ユーザ設定
VMでは、SNMPv3にアクセスするために最大5人のユーザを作成できます。
ユーザを新規で作成する場合は、認証およびプライバシーパスワードとSNMPエージェントエンジンIDに基づいてプライバシー、認証ハッシュ値を生成する必要があります。
まず、以下のコマンドを実行してユーザのプライバシーと認証のハッシュ値を取得します。
(snmppass1,snmppass2の部分はそれぞれ好きに設定してOK)
[root@localhost:~] esxcli system snmp hash --raw-secret --auth-hash snmppass1 --priv-hash snmppass2
Authhash: 1e37504f5218ad794723d380a0caaf193716839e
Privhash: 7e78dcbebe71b4029297499d83581fc5afbadd34
このハッシュ値もZabbix側の設定時に必要となるのでメモします。
SNMP送信先の設定
[root@locaohost:~] esxcli system snmp set --v3targets xxx.xxx.xxx.xxx@162/User/priv/trap
xxx.xxx.xxx.xxxには送信先のIP(今回はZabbixServerのIP)
Userには自身のユーザを入力してください。
SNMPの有効化
最後にSNMPの有効化設定を行います。
[root@locaohost:~] esxcli system snmp set --true
こちらは割愛します。
SNMP設定確認、およびテスト
SNMPの設定確認に関しては、”esxcli system snmp get”を実行して、確認を行ってください。
テストは以下を実行します。
[root@iso-vsphere7:~] esxcli system snmp test
Comments: There is 1 target configured, send warmStart requested, test completed normally.
特に設定に問題がなければ、”
Comments: There is 1 target configured, send warmStart requested, test completed normally.”
が表示されるはずです。
以上でESXi側の設定は完了です。