LoginSignup
2
1

More than 3 years have passed since last update.

ESXiにおいてのSNMPの設定をする。(ターゲットの最大数)

Posted at

ESXiでSNMPの設定を実施したい場合はhostclientからGUIでは出来ない。
そのため公式ドキュメントの通り記載の通りDCUIまたはSSHで設定する必要がある。
※SNMPはv2で設定してみる。

※環境はNestESXiで
VMware ESXi 6.7.0 build-13006603
VMware ESXi 6.7.0 Update 2

設定してみる

現在の設定値を取得

[root@nestesxi01:~] esxcli system snmp get
   Authentication: 
   Communities: 
   Enable: false
   Engineid: 
   Hwsrc: indications
   Largestorage: true
   Loglevel: info
   Notraps: 
   Port: 161
   Privacy: 
   Remoteusers: 
   Syscontact: 
   Syslocation: 
   Targets: 
   Users: 
   V3targets: 
[root@nestesxi01:~] 

ドキュメント記載の通りにとりあえず設定値を入れてみる

書式は”esxcli system snmp set --targets targetのaddress@port/community名”
このコマンドでターゲットを指定するたびに、指定した設定によって、以前指定された設定が上書きされます。

[root@nestesxi01:~] esxcli system snmp set --targets 192.0.2.1@163/westnoc
[root@nestesxi01:~] esxcli system snmp get
[root@nestesxi01:~] esxcli system snmp set --enable true
   Authentication: 
   Communities: 
   Enable: true
   Engineid: 
   Hwsrc: indications
   Largestorage: true
   Loglevel: info
   Notraps: 
   Port: 161
   Privacy: 
   Remoteusers: 
   Syscontact: 
   Syslocation: 
   Targets: 192.0.2.1@163 westnoc
   Users: 
   V3targets: 

これで設定はできる。(サービスの有効化も忘れずに)
初期値(インストール時)に戻したい時は

[root@nestesxi01:~]  system snmp set -r

※他の詳細なコマンドなオプションは以下で確認できます。

[root@nestesxi01:~] esxcli system snmp set --help

実際の設定時に困ったこと

残念なことにESXiの仕様としてSNMPのターゲットは最大3つまでしか設定できないようです。

最大3つのSNMP v1 / v2cターゲットに加えて、最大3つのSNMP v3ターゲットを設定できます。

https://translate.google.com/translate?hl=ja&sl=en&u=https://communities.vmware.com/thread/430388&prev=search
情報が古いですが探し方が悪いのか6.7のドキュメントからは見つけられませんでした。。。

[root@nestesxi01:~] esxcli system snmp set --targets 192.0.2.1@163/westnoc,192.0.2.2@163/westnoc,192.0.2.3@163/westnoc,192.0.2.4@163/westnoc,
too many targets specified

※おこられる

[root@nestesxi01:~] esxcli system snmp set --targets 192.0.2.1@163/westnoc,192.0.2.2@163/westnoc,192.0.2.3@163/westnoc
[root@nestesxi01:~] esxcli system snmp get
   Authentication: 
   Communities: 
   Enable: false
   Engineid: 
   Hwsrc: indications
   Largestorage: true
   Loglevel: info
   Notraps: 
   Port: 161
   Privacy: 
   Remoteusers: 
   Syscontact: 
   Syslocation: 
   Targets: 192.0.2.1@163 westnoc, 192.0.2.2@163 westnoc, 192.0.2.3@163 westnoc
   Users: 
   V3targets: 

※3つだと設定できる。

ESXiをSNMPで監視をする際は留意するべきかもしれません。(vCenterで監視するような気がしますが)

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1