chenqb 发表于 2015-4-3 15:38:33

ESX4 通过VMware vSphere CLI 开启snmp

  发现VMware vSphere CLI的功能实在强大,学习中。。。
  To configure the communities do the following:
  vicfg-snmp.pl –server–username–password-c .
  Replacewith the community name you wish to set. Each time you specify a community with this
  command, the setings you specify overwrite the previous configuration. To specify multiple communities,
  separate the community names with a comma.
  For example, to set the communities public and internal on the host host.example.com, you might type
  vicfg-snmp.pl –server host.example.com –username user –password password -c public,
  internal.
  vicfg-snmp.pl –server–username–password-c .
  Replacewith the community name you wish to set. Each time you specify a community with this
  command, the setings you specify overwrite the previous configuration. To specify multiple communities,
  separate the community names with a comma.
  For example, to set the communities public and internal on the host host.example.com, you might type
  vicfg-snmp.pl –server host.example.com –username user –password password -c public, internal.
  To configure the SNMP agent traps do:
  vicfg-snmp.pl –server–username–password-t @/.
  Replace , , andwith the address of the target system, the port number
  to send the traps to, and the community name, respectively. Each time you specify a target with this
  command, the settings you specify overwrite all previously specified settings. To specify multiple targets,
  
  separate them with a comma.
  For example, to send SNMP traps from the host host.example.com to port 162 on target.example.com using
  the public community, type
  vicfg-snmp.pl –server host.example.com –username user –password password -t
  target.example.com@162/public.
  Enable the SNMP agent by typing
  vicfg-snmp.pl –server–username–password–enable.
  Send a test trap to verify that the agent is configured correctly by typing
  vicfg-snmp.pl –server–username–password–test.
  The agent sends a warmStart trap to the configured target.
  To configure the SNMP agent for polling do:
  vicfg-snmp.pl –server–username–password-p .
  Replacewith the port for the embedded SNMP agent to use for listening for polling requests.
  If the SNMP agent is not enabled, enable it by typing
  vicfg-snmp.pl –server–username–password–enable.
  And there you have it SNMP on ESX4i.
  
  本人执行以上命令后,结果如下:
  
Current SNMP agent settings:
Enabled: 1
UDP port : 161
Communities :
public
Notification targets :
192.168.9.3@162/public
  /Files/qlight/Configuring_SNMP_on_ESX4.pdf
页: [1]
查看完整版本: ESX4 通过VMware vSphere CLI 开启snmp