The snmpset utility sets the value of a specific instance of a MIB attribute using SNMP. To set an OID value, a read-write community string for SNMPv1/SNMPv2c is required and a read-write SNMPv3 user is required for SNMPv3. When you run this command, the MIB object and its new value appear. Use the -w parameter to produce a more readable output similar to the walktree utility.
This utility has the following format:
snmpset
[-h hostname | ip_addr]
[-p port]
[-c community]
[-v 1 | 2c | 3]
[-u secName]
[-s secLevel]
[-n contextName]
[-a authPassword] [-A MD5 | SHA]
[ -x privPassword] [-X DES | AES | 3DES]
[-m FIPS_mode]
[-r retries]
[-t timeout]
[-d logLevel]
[-f logFile]
[-b ]
[-w]
[-o] [OID] [OID-type] [OID-value]
Specifies the host name or IP address of the system on which the agent is running. Accepts IPv4 and IPv6 addresses.
Default: localhost
Specifies the UDP port that the agent is running on (for example, 1691).
Default: 161
Specifies a community string that the agent uses. Valid for SNMPv1 and SNMPv2c only.
Note: Specify a read/write community string for snmpset.
Default: public
Indicates the version of SNMP that the agent is running. Specify 1 for SNMPv1, 2c for SNMPv2c, or 3 for SNMPv3.
Default: 1
Specifies the User-based Security Model (USM) user name used for SNMPv3 security.
Default: none
Specifies one of the following security levels for SNMPv3 communication:
3 - AuthPriv (SNMPv3 only)
Specifies the instance name for MIBMuxed agent.
Default: none
Specifies the authentication password if the agent is configured for SNMPv3 with secLevel 2 (AuthNoPriv) or 3 (AuthPriv).
Note: This option is not required for SNMPv3 communication.
Default: none
Specifies the authentication protocol to use if the agent is configured for SNMPv3 with secLevel 2 (AuthNoPriv) or 3 (AuthPriv). Currently only MD5 (Message Digest Algorithm) and SHA (Secure Hash Algorithm) are used.
Default: MD5
Specifies the privacy (encryption) password if the agent is configured for SNMPv3 with secLevel 3 (AuthPriv).
Default: none
Specifies the privacy protocol if the SNMPv3 user is configured with secLevel 3 (AuthPriv). Specify DES for Data Encryption Standard, AES for Advanced Encryption Standard using cryptographic keys of 128 bits (AES128), and 3DES for Triple Data Encryption Standard.
Default: none
Controls the FIPS mode of operation. Accepted values are 0, 1, and 2.
Indicates Non-FIPS mode.
Indicates FIPS co-existence mode.
Indicates FIPS only mode.
Default: 1
Specifies the number of retries.
Default: 10
Specifies the duration before the SNMP receiver considers the request as timed out.
Default: 10 seconds
Specifies the log level of the SNMP messages. Accepted values are 0 to 5.
Logs fatal messages.
Logs critical messages.
Logs warning messages.
Logs informational messages.
Logs all of the messages.
Logs all of the messages including debugging messages.
Default: 0
Specifies the name of the log file that contains error and debug information.
Default: sysedge_utility.log
Displays the value in hexadecimal format. Applies to snmpget, snmpset, and walktree utilities only.
Specifies to return walktree like format.
Specifies the object identifier (OID) to be set or queried for the snmpget, snmpset, and walktree utilities.
Default: none
Specifies the type of the OID value that you are setting. The following are possible values:
integer
octet
string
object identifier
IP address
counter value
64 bit counter value
gauge
time ticks
hexadecimal-encoded binary data (opaque)
Specifies the value of the OID you want to set. The type of the OID value should match OID-type.
Notes: The [OID] [OID-type] [OID-value] pair (commonly referred as varbinds) should be the last arguments for snmpset, and you should specify them in this order. You can give multiple OID pairs a single snmpset call. See the examples below.
Examples
snmpset -c admin -o 1.3.6.1.2.1.1.4.0 -s "syscontact update"
snmpset -c admin -o sysContact.0 -s "syscontact update"
snmpset -h Ea2f:fe90:abcd:0000:230:a2f:200:ad01 -c admin -o 1.3.6.1.2.1.1.4.0 -s "syscontact update" 1.3.6.1.2.1.1.6.0 -s "syslocation update"
snmpset -h box1.domain.com -p 2009 -c admin -v 1 -o 1.3.6.1.2.1.1.4.0 -s "syscontact update" 1.3.6.1.2.1.1.6.0 -s "syslocation update"
snmpset -c admin -v 2c -h Ea2f:fe90:abcd:0000:230:a2f:200:ad01 -o 1.3.6.1.2.1.1.6.0 -s "syslocation update"
snmpset -p 2009 -u user3v3 -v 3 -s 1 -o 1.3.6.1.2.1.1.4.0 -s "syscontact update" 1.3.6.1.2.1.1.6.0 -s "syslocation update"
snmpset -p 2009 -u user2v3 -A SHA -a osa -v 3 -s 2 -m 2 -o 1.3.6.1.2.1.1.6.0 -s "syslocation update"
snmpset -p 2009 -h 130.10.100.101 -u user1v3 -A SHA -a osa -X AES -x osp -v 3 -s 3 -t 30 -o 1.3.6.1.2.1.1.4.0 -s "syscontact update" 1.3.6.1.2.1.1.6.0 -s "syslocation update"
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |