snmpsetany(1M) DG/UX R4.11MU05 snmpsetany(1M)
NAME
snmpsetany - set value of SNMP MIB-object
SYNOPSIS
snmpsetany [-n][-t] host community [ object type value ] ...
where:
host A hostname or Internet address
community A community string
object An object instance
value A value to be assigned to object
DESCRIPTION
Use the snmpsetany command to assign a new value to object managed by
the SNMP agent running on host. The agent authenticates the request
by checking that community has write access to object. If community
does not exist, the agent discards the request, and snmpsetany will
fail because of a timeout. If community does not have write access,
the agent will return a "No Such Name" failure. During the set
operation the agent checks type and value and if they are incorrectly
specified will return a "Bad Value" failure. If the request is
valid, the agent assigns value to object.
The MIB defines a type for each object. A request to change a value
of an object must specify the correct type or the request will fail.
The snmpsetany command also uses the type field to determine how to
parse the value field.
Specify host as either a hostname or an Internet address in dot-
notation.
The community string is a text string used by the agent to
authenticate the request. For the operation to be successful the
community must be configured with read-write access for the agent
running on host.
Specify object as either an object identifier in dot-notation or as
an object descriptor using a text string.
Types are:
-i value is integer type (e.g., 123)
-o value is octet string type in hexadecimal notation (e.g., "FF
EE 12")
-D value is display string type (e.g., "hello world")
-d value is object identifier type in dot notation or symbolic
form. (e.g., 1.3.6.1.4.1.106.2.1.2.2.6.2.1.3 or
dguxLpSysDefaultDest)
-a value is Internet address type in dot notation (e.g.,
127.0.0.1)
-c value is counter type (e.g., 12345)
-g value is gauge type (e.g., 12345)
-t value is time-tick type (e.g., 12345)
-u value is 32 bit unsigned integer (e.g., 12345)
-N value is NULL.
Options are:
-n Use numeric format for Object IDs instead of translating them
into a symbolic name.
-t Print the data type of the object.
EXAMPLES
The following example demonstrates how snmpsetany can be used to
change the state of the loopback device using the object
ifAdminStatus.
$ snmpgetmany myhost public ifDescr.2
ifDescr.1 = inen0
ifDescr.2 = loop0
$ snmpgetone myhost public ifOperStatus.2
ifOperStatus.2 = 2
$ ifconfig loop0
loop0: 127.0.0.1 flags=48<LOOPBACK, RUNNING>
netmask = 0xff000000 metric = 0
$ snmpsetany myhost MyReadWriteCommunity ifAdminStatus.2 -i 1
ifAdminStatus.2 = 1
$ ifconfig loop0
loop0: 127.0.0.1 flags=449<UP,LOOPBACK,RUNNING,STARTED>
netmask = 0xff000000 metric = 0
DIAGNOSTICS
Exit status is 0 upon success.
Exit status is -1 if there are errors parsing the command line.
Exit status is 1 if the agent returns an error.
SEE ALSO
snmpgetone(1M), snmpgetmany(1M), snmpgetnext(1M), snmptraprecv(1M),
snmptrapsend(1M), snmpgettab(1M), snmpd(1M), snmpd.conf(4M),
snmpdfiles(4M).
Licensed material--property of copyright holder(s)