


無償版のVMware vSphere Hypervisor 5.1のsnmpをコマンドから有効にできるか確認してみました
VMware vSphere Hypervisor
http://www.vmware.com/jp/products/datacenter-virtualization/vsphere-hypervisor/overview.html
VMware vSphere Hypervisor 5.1にvMA5.0をデプロイしてvicfg-snmpコマンドで設定してみます
- sshでvMA5.0にログイン
- Hypervisor 5.1を登録
- ターゲットを指定
- vicfg-snmp
- vicfg-snmp -s
- trapの設定
sshクライアントからvMA5.0にログインします
snmpを有効にするHypervisor hostを管理サーバに登録します
vi-admin@vma5:~> vifp addserver vmesxi.rootlinks.net
vi-admin@vma5:~> vifp listservers
vmesxi.rootlinks.net ESXi
管理hostを指定します
vi-admin@vma5:~> vifptarget -s vmesxi.rootlinks.net
snmpを設定するvicfg-snmpコマンドの使用方法です
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
vi-admin@vma5:~[vmesxi.rootlinks.net]>vicfg-snmp --help Synopsis: /usr/bin/vicfg-snmp OPTIONS Command-specific options: --communities -c Set communities separated by comma comm1[,...] (this overwrites previous settings) --disable -D Stop SNMP service --enable -E Start SNMP service --hwsrc -y Where to source hardware events from IPMI sensors or CIM Indications. One of: indications|sensors --notraps -n Comma separated list of trap oids for traps not to be sent by agent. Use value 'reset' to clear setting --port -p Sets the port of the snmp agent. The default is udp/162 --reset -r Return agent configuration to factory defaults --show -s Displays snmp agent configuration --targets -t Set destination of notifications(traps) hostname[@port][/community][,...] (this overwrites previous settings) (IPv6 address valid for vSphere 4.0 and later) --test -T Send out a test notification to validate configuration --vihost -h The host to use when connecting via a vCenter Server. Common VI options: --config (variable VI_CONFIG) Location of the VI Perl configuration file --credstore (variable VI_CREDSTORE) Name of the credential store file defaults to <HOME>/.vmware/credstore/vicredentials.xml on Linux and <APPDATA>/VMware/credstore/vicredentials.xml on Windows --encoding (variable VI_ENCODING, default 'utf8') Encoding: utf8, cp936 (Simplified Chinese), iso-8859-1 (German), shiftjis (Japanese) --help Display usage information for the script --passthroughauth (variable VI_PASSTHROUGHAUTH) Attempt to use pass-through authentication --passthroughauthpackage (variable VI_PASSTHROUGHAUTHPACKAGE, default 'Negotiate') Pass-through authentication negotiation package --password (variable VI_PASSWORD) Password --portnumber (variable VI_PORTNUMBER) Port used to connect to server --protocol (variable VI_PROTOCOL, default 'https') Protocol used to connect to server --savesessionfile (variable VI_SAVESESSIONFILE) File to save session ID/cookie to utilize --server (variable VI_SERVER, default 'localhost') VI server to connect to. Required if url is not present --servicepath (variable VI_SERVICEPATH, default '/sdk/webService') Service path used to connect to server --sessionfile (variable VI_SESSIONFILE) File containing session ID/cookie to utilize --url (variable VI_URL) VI SDK URL to connect to. Required if server is not present --username (variable VI_USERNAME) Username --verbose (variable VI_VERBOSE) Display additional debugging information --version Display version information for the script |
以前、直接/etc/vmware/snmp.xmlファイルを編集してsnmpを有効に設定したのでコマンドで確認してみます
vi-admin@vma5:~[vmesxi.rootlinks.net]> vicfg-snmp -s
Current SNMP agent settings:
Enabled : 1
UDP port : 161Communities :
publicNotification targets :
Options :
EnvEventSource=indications
engineid=00000063000000a1c0a80a00
loglevel=info
試しにtrap先を設定してみます
vi-admin@vma5:~[vmesxi.rootlinks.net]> vicfg-snmp -t 192.168.1.254/public
Changing notification(trap) targets list to: 192.168.1.254/public…
Failed : Current license or ESXi version prohibits execution of the requested operation.
無償版のHypervisor 5.1ではコマンドでの参照は出来ますが設定変更は出来ませんでした
無償版のHypervisor 5.1でsnmpを有効にするには直接ファイルを編集するしな無いようです
Enable snmp on ESXi 5.1
http://www.rootlinks.net/2012/10/01/enable-snmp-on-esxi-5-1/
~ # cat /etc/vmware/snmp.xml
<?xml version=”1.0″?>
<config><snmpSettings><enable>true</enable><communities>public</communities><targets><targets/><engineid>00000063000000a1c0a80a00</engineid></snmpSettings></config>