In some network environments, you are required to specify the SNMP version, community name, hostname, and default port when issuing SNMP commands. For example, to request the value of the object identifier (OID) sysDescr.0 in an IPv4 environment, you might type the following:
%snmpget -v2c -c public 192.0.2.1:161 sysDescr.0
However, it is possible to configure your network environment such that most command-line arguments are not necessary. For example, for SNMP v1 or v2c, if you set default values for the SNMP version, community name, and default port, the following syntax is considered valid:
%snmpget SNMP_agent sysDescr.0
Throughout this guide, SNMP_agent refers to the hostname or IP address of the system you are querying.
In addition, the examples in this guide omit most command-line arguments. To configure your network so that most command-line arguments are not necessary, see the following procedure: