vicfg-snmp - configure the SNMP service
vicfg-snmp [<connection_options>] [--communities <comm_list> | --disable | --enable | --help | --hwsrc | --notraps | --port <port_number> | --reset | --show | --targets <targets> | --test | --vihost <esx_host>]
Simple Network Management Protocol (SNMP) allows management programs to monitor and control networked devices. The Basic System Administration manual discusses using SNMP in your vSphere environment in some detail. The vSphere Command-Line Interface Scripting Guide explains setup with vSphere CLI commands.
Specifies communities, separated by commas. The settings specified using this option overwrite any previous settings.
Specifies the target server and authentication information if required. Run vicfg-snmp --help
for a list of all connection options.
Stops the SNMP service on the host.
Starts the SNMP service on the host.
Prints a help message for each command-specific and each connection option.
Calling the script with no arguments or with --help
has the same effect.
Allows you to specify where to source hardware events originating from IPMI sensors or from CIM indications. Specify either indications
or sensors
.
Comma-separated list of trap OIDs (object identifiers) for traps not to be sent by the agent. Use --notraps reset
to clear the list.
Sets the port used by the SNMP agent. The default is UDP 161.
This is the port that the SNMP service uses to listen on for polling requests,
such as GET requests. You can also configure the port that the SNMP agent sends
data to on the target system using the --targets
option. That port is UDP 162 by default.
Clears all previously-specified communities and targets.
Displays the current SNMP configuration.
Sets the destination for (notifications) traps. You can specify multiple targets, separated by commas.
The settings specified using this flag overwrite any previous settings. For vSphere 4.0 and later, IPv6 addresses are valid.
Sends a test notification that can be used to validate the SNMP configuration to the configured target or targets.
When you run a vSphere CLI command with the --server
option pointing
to a vCenter Server system, use --vihost
to specify the ESX/ESXi host to run the command against.
The following examples assume you are specifying connection options, either explicitly or, for example, by specifying the server, user name, and password. Run vicfg-snmp --help for a list of common options including connection options.
Display the SNMP agent configuration:
vicfg-snmp <conn_options> -s
Set the community for the SNMP agent to public:
vicfg-snmp <conn_options> -c public
Set my_comm1 and my_comm2 as the communities, overwriting any existing communities.
vicfg-snmp <conn_options> -c my_comm1,my_comm2
Enable the SNMP service:
vicfg-snmp <conn_options> -E
Disable the SNMP service:
vicfg-snmp <conn_options> -D
Set the SNMP agent port to port 163:
vicfg-snmp <conn_options> -p 163