setany(1M) TCP/IP 5.4.2 setany(1M)
NAME
setany - set value of SNMP MIB-object
SYNOPSIS
setany 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 setany command to assign values to object instances. The
command sends an SNMP message containing the community string and a
SetReqest-PDU requesting the value of the type specified by type to
be assigned to the object by the agent running on host.
Specify the 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 the 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")
-s value is display string type (e.g., "hello world")
-d value is object identifier type in dot notation (e.g.,
1.3.6.1.2.1.2)
-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 guage type (e.g., 12345)
-t value is time-tick type (e.g., 12345)
EXAMPLES
The following example demonstrates how setany can be used to change
the state of the loopback device.
$ getmany myhost public ifOperStatus
Licensed material--property of copyright holder(s) 1
setany(1M) TCP/IP 5.4.2 setany(1M)
Name: ifOperStatus.1
Value: 1
Name: ifOperStatus.2
Value: 2
$ getone myhost public ifDescr.2
Name: ifDescr.2
Value: loop0
$ ifconfig loop0
loop0: 127.0.0.1 flags=48<LOOPBACK, RUNNING>
netmask = 0xff000000 metric = 0
$ setany myhost MyReadWriteCommunity ifAdminStatus.2 -i 1
Name: ifAdminStatus.2
Value: 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
getone(1M), getmany(1M), getnext(1M), snmpd(1M), traprecv(1M),
trapsend(1M), snmpd.communities(4M), snmpd.config(4M),
snmpd.trapcommunities(4M).
Licensed material--property of copyright holder(s) 2