Chinaunix首页 | 论坛 | 博客
  • 博客访问: 566000
  • 博文数量: 375
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 15
  • 用 户 组: 普通用户
  • 注册时间: 2013-09-20 10:21
文章分类

全部博文(375)

文章存档

2015年(1)

2014年(374)

分类: LINUX

2014-08-18 13:39:07

原文地址:snmpdelta 命令手册 作者:ailms

NAME
       snmpdelta - Monitor deltas of integer valued SNMP variables
 
# 注释 :snmpdelta 命令用于监测整数型的 SNMP 对象的值的增量
 

 
SYNOPSIS
       snmpdelta  [  common  options ] [-Cf] [ -Ct ] [ -Cs ] [ -CS ] [ -Cm ] [ -CF configfile ] [ -Cl ] [ -Cp period ] [ -CP Peaks ] [ -Ck ] [ -CT  ]
       AGENT OID [ OID ... ]
 
# 注释 :snmpdelta 命令的格式
 

 
 
DESCRIPTION
       snmpdelta  will monitor  the specified integer valued OIDs, and report
       changes over time.
 
       AGENT identifies a target SNMP agent, which is instrumented to  monitor
       the  gievn objects.  At its simplest, the AGENT specification will con-
       sist of a hostname or an IPv4 address.  In this situation, the  command
       will  attempt  communication with the agent, using UDP/IPv4 to port 161
       of the given target host. See snmpcmd(1) for a full list of the possi-
       ble formats for AGENT.
 
       OID  is an object identifier which uniquely identifies the object type
       within a MIB. Multiple OIDs can be specified on a single snmpdelta com-
       mand.

 

OPTIONS
       COMMON OPTIONS
        Please  see snmpcmd(1) for a list of possible values for COMMON
        OPTIONS as well as their descriptions.
 
       -Cf  
        Don't fix errors and retry the request. Without  this  option,
        if  multiple  oids have been specified for a single request and
        if the request for one or more of  the  oids  fails,  snmpdelta
        will  retry  the  request  so that data for oids apart from the
        ones that failed will still be returned.  Specifying -Cf  tells
        snmpdelta  not  to  retry a request, even if there are multiple
        oids specified.
 
       -Ct 
 
        Flag will determine time interval from the monitored entity.
 
        # 注释 :-Ct 表示由 snmp 决定监测的时间间隔
 
       -Cs
 
         Flag will display a timestamp.
 
        # 注释 :-Cs 表示显示时间戳
 
       -CS
 
         Generates a "sum count" in addition to the individual  instance
        counts.  The  "sum  count"  is the total of all the individual
        deltas for each time period.
 
        # 注释 :-CS 表示为每个单独的实例生成一个统计和。
 
       -Cm
 
         Prints the max value ever attained.
 
        # 注释 :-Cm 表示打印监测期间所捕捉到的最大值
 
       -CF configfile

        Tells snmpdelta to read it's configuration from the  specified
        file.   This  options  allows the input to be set up in advance
        rather than having to be specified on the command line.
 
        # 注释 :-CF 告诉 snmpdelta 从指定的地方读取配置文件
 
       -Cl 
        Tells snmpdelta to write  it's  configuration  to  files  whose
        names  correspond to the MIB instances monitored.  For example,
        snmpdelta -Cl localhost ifInOctets.1 will create a file "local-
        host-ifInOctets.1".
 
        # 注释 :-Cl 告诉 snmpdelta 把配置写入以监测对象命令的文件中,便于以后重复引用
 
       -Cp
         Specifies  the  number  of  seconds  between  polling  periods.
        Polling constitutes sending a request to the agent. The default
        polling period is one second.
 
        # 注释 :-Cp 设置轮询的时间间隔,单位是秒。默认是1秒
 
       -CP peaks
        Specifies  the  reporting  period in number of polling periods.
        If this option is specified, snmpdelta polls  the  agent  peaks
        number  of  times  before  reporting  the  results.  The result
        reported includes the average value over the reporting  period.
        In  addition,  the  highest  polled  value within the reporting
        period is shown.
 
        # 注释 :-CP 设置轮询的次数
 
        # 注意 :如果指定了-Cp 和 -CP ,则每行输出的时间间隔为 Cp * CP = N sec
 
       -Ck 
        When the polling period (-Cp) is an increment of 60 seconds and
        the  timestamp  is  displayed  in  the  output  (-Cs), then the
        default display shows the timestamp in the format hh:mm mm/dd.
        This option causes the timestamp format to be hh:mm:ss mm/dd.
 
        # 注释 :-Ck 表示按 hh:mm:ss mm/dd 的格式显示时间
 
        # 如果要显示应该选择这个,如果要通过程序处理,还是默认的好
 
       -CT 
        Makes snmpdelta print its output in tabular form.
 
        # 注释 :-CT 表示以表格的方式输出结果
 
       -Cv vars/pkt
        Specifies  the maximum number of oids allowed to be packaged in
        a single PDU. Multiple PDUs can be created in a single request.
        The  default  value of variables per packet is 60.  This option
        is useful if a request response results in an error becaues the
        packet is too big.
 
        # 注释 :-Cv vars/pkt 制定单个 PDU 内所允许监测的最大oid数量。
 
        # 多个 PDU 可以放在一个 packet 内。每个监测对象对应一个 PDU
 
        # 默认是 60 个。如果 agent 响应中指示 packet 太大,可以使用该选项
 
 
# 注释 :注意,如果没有指定轮询的次数,snmpdelta 将一直执行下去,直到输入 ctrl-c

 
EXAMPLES
       $ snmpdelta -c public -v 1 -Cs localhost IF-MIB::ifInUcastPkts.3 IF-MIB::ifOutUcastPkts.3
       [20:15:43 6/14] ifInUcastPkts.3 /1 sec: 158
       [20:15:43 6/14] ifOutUcastPkts.3 /1 sec: 158
       [20:15:44 6/14] ifInUcastPkts.3 /1 sec: 184
       [20:15:44 6/14] ifOutUcastPkts.3 /1 sec: 184
       [20:15:45 6/14] ifInUcastPkts.3 /1 sec: 184
       [20:15:45 6/14] ifOutUcastPkts.3 /1 sec: 184
       [20:15:46 6/14] ifInUcastPkts.3 /1 sec: 158
       [20:15:46 6/14] ifOutUcastPkts.3 /1 sec: 158
       [20:15:47 6/14] ifInUcastPkts.3 /1 sec: 184
       [20:15:47 6/14] ifOutUcastPkts.3 /1 sec: 184
       [20:15:48 6/14] ifInUcastPkts.3 /1 sec: 184
       [20:15:48 6/14] ifOutUcastPkts.3 /1 sec: 184
       [20:15:49 6/14] ifInUcastPkts.3 /1 sec: 158
       [20:15:49 6/14] ifOutUcastPkts.3 /1 sec: 158
       ^C

       $ snmpdelta -c public -v 1 -Cs -CT localhost IF-MIB:ifInUcastPkts.3 IF-MIB:ifOutcastPkts.3    // 明显好看多了,也便于 awk ,cut 的处理
       localhost ifInUcastPkts.3     ifOutUcastPkts.3
       [20:15:59 6/14]    184.00    184.00
       [20:16:00 6/14]    158.00    158.00
       [20:16:01 6/14]    184.00    184.00
       [20:16:02 6/14]    184.00    184.00
       [20:16:03 6/14]    158.00    158.00
       [20:16:04 6/14]    184.00    184.00
       [20:16:05 6/14]    184.00    184.00
       [20:16:06 6/14]    158.00    158.00
       ^C
 
       The  following example uses a number of options. Since the Cl option is
       specified, the output is sent to a file and not to the screen.
 
       $ snmpdelta -c public -v 1 -Ct -Cs -CS -Cm -Cl -Cp 60 -CP 60
  interlink.sw.net.cmu.edu .1.3.6.1.2.1.2.2.1.16.3 .1.3.6.1.2.1.2.2.1.16.4
       fi
 
# 注释 :snmpdelta 命令完全可以考虑当成一个 NMS 来用,虽然只能监测整数型的 snmp object ,但已经足够了
 
# 对于字符型的 snmp object ,不太可能变动,也就无须监测了,即使监测,每次返回的值也都是0。
 
# 补充 :snmpdelta 和 snmpget 一样,在给出的 oid 时必须以 . 的格式,不能仅仅是 object 而已
 

 
SEE ALSO
       snmpcmd(1), variables(5).
 
 
 
4th Berkeley Distribution   25 Jul 2003     SNMPDELTA(1)
阅读(796) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~