snmpset 中的几种数据类型

SNMPSET 是用于设置SNMP代理中特定变量值的命令。文中介绍了SNMPSET的NAME、SYNOPSIS、DESCRIPTION等内容,并给出了使用示例,如设置sysContact.0和ipForwarding.0的值。当请求处理出错时,会返回错误信息帮助定位问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

样例

snmpwalk -v2c -c public 10.10.28.123 .1.3.6.1.4.1.4491.2.1.2.1.3.1.1.8 
iso.3.6.1.4.1.4491.2.1.2.1.3.1.1.8.142672128 = INTEGER: 1
iso.3.6.1.4.1.4491.2.1.2.1.3.1.1.8.142672384 = INTEGER: 1
snmpset -On -v2c -c private 10.10.28.123 .1.3.6.1.4.1.4491.2.1.2.1.3.2.1.2.142672128.142672640 i 4 

SNMPSET

Section: Net-SNMP (1)
Updated: 08 Feb 2002
Index   Return to Main Contents
 

NAME

snmpset - communicates with a network entity using SNMP SET requests   

SYNOPSIS

snmpset  [COMMON OPTIONS] OID TYPE VALUE [OID TYPE VALUE]...   

DESCRIPTION

snmpset  is an SNMP application that uses the SNMP SET request to set information on a network entity. One or more object identifiers (OIDs) must be given as arguments on the command line. A type and a value to be set must accompany each object identifier. Each variable name is given in the format specified in  variables(5) .

The TYPE is a single character, one of:

i
INTEGER
u
UNSIGNED
s
STRING
x
HEX STRING
d
DECIMAL STRING
n
NULLOBJ
o
OBJID
t
TIMETICKS
a
IPADDRESS
b
BITS
Most of these will use the obvious corresponding ASN.1 type. 's', 'x', 'd' and 'b' are all different ways of specifying an OCTET STRING value, and the 'u' unsigned type is also used for handling Gauge32 values.

If you have the proper MIB file loaded, you can, in most cases, replace the type with an '=' sign. For an object of type OCTET STRING this will assume a string like the 's' type notation. For other types it will do "The Right Thing".

For example:

snmpset -c private -v 1 test-hub system.sysContact.0 s dpz@noc.rutgers.edu ip.ipforwarding.0 = 2

will set the variables sysContact.0 and ipForwarding.0:

system.sysContact.0 = STRING: "dpz@noc.rutgers.edu
ip.ipForwarding.0 = INTEGER: not-forwarding(2)

If the network entity has an error processing the request packet, an error packet will be returned and a message will be shown, helping to pinpoint in what way the request was malformed.  

OPTIONS

snmpset  takes the common options described in the  snmpcmd(1)  manual page.   

SEE ALSO

variables (5).


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
SEE ALSO

This document was created by  man2html , using the manual pages.
Time: 19:05:39 GMT, September 28, 2009
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值