NAME

vicfg-snmp - configure the SNMP service


SYNOPSIS

 vicfg-snmp [<connection_options>]
   [--communities <comm_list> |
    --disable |
    --enable |
    --help |
    --port <port_number> |
    --reset |
    --show |
    --targets <targets> |
    --test |
    --vihost <esx_host>]


DESCRIPTION

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.


OPTIONS

--communities | -c <comm1>[,...]

Specifies communities, separated by commas. The settings specified using this option overwrite any previous settings.

connection_options

Specifies the target server and authentication information if required. Run vicfg-snmp --help for a list of all connection options.

--disable | -D

Stops the SNMP service on the host.

--enable | -E

Starts the SNMP service on the host.

--help

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.

--port | -p <port_number>

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.

--reset | -r

Clears all previously-specified communities and targets.

--show | -s

Displays the current SNMP configuration.

--targets | -t <hostname[@port]> </community>[,...]

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.

--test | -T

Sends a test notification that can be used to validate the SNMP configuration to the configured target or targets.

--vihost | -h

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.


EXAMPLES

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