Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 247559

Re: SNMP configuration with powerCLI

$
0
0

You can (or maybe should) use esxcli for configuring SNMP on ESXi 5.1 hosts.

 

esxcli system snmp get, set and test should provide you with everything you need. In PowerCLI you can execute any esxcli command via Get-EsxCli: http://www.vmware.com/support/developer/PowerCLI/PowerCLI41U1/html/Get-EsxCli.html

 

 

Here are some example commands to configure SNMP via esxcli:

http://blogs.vmware.com/vsphere/2012/11/configuring-snmp-v1v2cv3-using-esxcli-5-1.htmlhttp://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Get-EsxCli.html

# esxcli system snmp set --help
Usage: esxcli system snmp set [cmd options]

 

Description:
  set                   This command allows the user to set up ESX SNMP agent.

 

Cmd options:
  -a|--authentication=<str>
                        Set default authentication protocol. Values: none, MD5, SHA1
  -c|--communities=<str>
                        Set up to ten communities each no more than 64 characters. Format is: community1[,community2,...] (this overwrites previous settings)
  -e|--enable           Start or stop SNMP service. Values: [yes|no, true|false, 0|1]
  -E|--engineid=<str>   Set SNMPv3 engine id. Must be at least 5 to 32 hexadecimal characters. 0x is stripped if found as well as colons (:)
  -y|--hwsrc=<str>      Where to source hardware events from IPMI sensors or CIM Indications. One of: indications|sensors
  -l|--loglevel=<str>   System Agent syslog logging level: debug|info|warning|error
  -n|--notraps=<str>    Comma separated list of trap oids for traps not to be sent by agent. Use value 'reset' to clear setting
  -p|--port=<long>      Set UDP port to poll snmp agent on. The default is udp/161
  -x|--privacy=<str>    Set default privacy protocol. Values: none, AES128
  -R|--remote-users=<str>
                        Set up to five inform user ids. Format is: user/auth-proto/-|auth-hash/priv-proto/-|priv-hash/engine-id[,...] Where user is 32 chars max.
                        auth-proto is none|MD5|SHA1, priv-proto is none|AES. '-' indicates no hash. engine-id is hex string '0x0-9a-f' up to 32 chars max.
  -r|--reset            Return agent configuration to factory defaults
  -C|--syscontact=<str> System contact string as presented in sysContact.0. Up to 255 characters
  -L|--syslocation=<str>
                        System location string as presented in sysLocation.0. Up to 255 characters.
  -t|--targets=<str>    Set up to three targets to send SNMPv1 traps to. Format is: ip-or-hostname[@port]/community[,...] The default port is udp/162. (this
                        overwrites previous settings)
  -u|--users=<str>      Set up to five local users. Format is: user/-|auth-hash/-|priv-hash/model[,...] Where user is 32 chars max. '-' indicates no hash. Model is
                        one of (none|auth|priv).
  -i|--v3targets=<str>  Set up to three SNMPv3 notification targets. Format is: ip-or-hostname[@port]/remote-user/security-level/trap|inform[,...].


Viewing all articles
Browse latest Browse all 247559

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>