April 2022

You are currently browsing the monthly archive for April 2022.

使用的MIB 库为CISCO-PING-MIB, 具体步骤如下:

# 清除之前操作
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.16.111 i 6
SNMPv2-SMI::enterprises.9.9.16.1.1.1.16.111 = INTEGER: 6

#创建实例编号为 111 的条目
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.16.111 i 5
SNMPv2-SMI::enterprises.9.9.16.1.1.1.16.111 = INTEGER: 5

#设置ping 的name
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.15.111 s test
SNMPv2-SMI::enterprises.9.9.16.1.1.1.15.111 = STRING: "test"

# 设置 ping的包位IP 包
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.2.111 i 1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.2.111 = INTEGER: 1

# 设置ping的地址位 9.1.0.6 > hex 09010006
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.3.111 x 09010006
SNMPv2-SMI::enterprises.9.9.16.1.1.1.3.111 = Hex-STRING: 09 01 00 06

#设置ping的个数
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.4.111 i 5
SNMPv2-SMI::enterprises.9.9.16.1.1.1.4.111 = INTEGER: 5

#设置vrf name
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.17.111 s 123
SNMPv2-SMI::enterprises.9.9.16.1.1.1.17.111 = STRING: "123"
[root@server1 ~]#
[root@server1 ~]#

#检查设置的参数
[root@server1 ~]# snmpwalk -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.2.111 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.3.111 = Hex-STRING: 09 01 00 06
SNMPv2-SMI::enterprises.9.9.16.1.1.1.4.111 = INTEGER: 5
SNMPv2-SMI::enterprises.9.9.16.1.1.1.5.111 = INTEGER: 100
SNMPv2-SMI::enterprises.9.9.16.1.1.1.6.111 = INTEGER: 2000
SNMPv2-SMI::enterprises.9.9.16.1.1.1.7.111 = INTEGER: 0
SNMPv2-SMI::enterprises.9.9.16.1.1.1.8.111 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.16.1.1.1.14.111 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.16.1.1.1.15.111 = STRING: "test"
SNMPv2-SMI::enterprises.9.9.16.1.1.1.16.111 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.16.1.1.1.17.111 = STRING: "123"
[root@server1 ~]#
[root@server1 ~]#

# 执行Ping 操作

[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.16.111 i 1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.16.111 = INTEGER: 1
[root@server1 ~]#

#检查ping的结果
[root@server1 ~]# snmpwalk -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.2.111 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.3.111 = Hex-STRING: 09 01 00 06
SNMPv2-SMI::enterprises.9.9.16.1.1.1.4.111 = INTEGER: 5
SNMPv2-SMI::enterprises.9.9.16.1.1.1.5.111 = INTEGER: 100
SNMPv2-SMI::enterprises.9.9.16.1.1.1.6.111 = INTEGER: 2000
SNMPv2-SMI::enterprises.9.9.16.1.1.1.7.111 = INTEGER: 0
SNMPv2-SMI::enterprises.9.9.16.1.1.1.8.111 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.16.1.1.1.9.111 = Counter32: 5          <<<< send packet
SNMPv2-SMI::enterprises.9.9.16.1.1.1.10.111 = Counter32: 5        <<<< receive packet
SNMPv2-SMI::enterprises.9.9.16.1.1.1.11.111 = INTEGER: 1           <<<< Minrtt
SNMPv2-SMI::enterprises.9.9.16.1.1.1.12.111 = INTEGER: 1           <<<<Avgrtt
SNMPv2-SMI::enterprises.9.9.16.1.1.1.13.111 = INTEGER: 1           <<<<Maxrtt
SNMPv2-SMI::enterprises.9.9.16.1.1.1.14.111 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.15.111 = STRING: "test"
SNMPv2-SMI::enterprises.9.9.16.1.1.1.16.111 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.17.111 = STRING: "123"

#删除ping 实例
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.16.111 i 6
SNMPv2-SMI::enterprises.9.9.16.1.1.1.16.111 = INTEGER: 6

In general, the structure of the syslog messages generated by IOS-XR has the following format:

<PRI><messageid>: <hostname> <linecard>:<datetime>: <process-name>[<process-id>]: %<facility-name>-<severity>-<tag>: <MSG>

  • messageid: The ID number of the message.
  • hostname: The device that generated the message.
  • linecard: The linecard slot.
  • datetime: The time when the message was generated in the format: MMM dd hh:mm:ss.fff or MMM dd hh:mm:ss.fff ZZZ.
  • process-name: The name of the process that generated the mesage.
  • process-id The PID of the process that generated the message.
  • facility-name: The name of the Facility.
  • severify: The value of the Severity.
  • tag: The syslog message tag.
<PRI>

<PRI> 包含两个内容5 bit Facility 和 3 bit Log Level.

Facility 用来表示log信息的来源或者说是log 信息的类别,默认IOS XR设备使用的是LOCAL 7 , id 23。

我们可以在log server 上进行定义不同Facility存储在不同文件中,或者具有不同的format格式, 如下。

[root@server1 ~]# grep  local /etc/rsyslog.conf 
local7.*                                                /var/log/boot.log
local6.*                                                /var/log/syslog

IOS XR中可以修改facility , 命令如下

RP/0/RP0/CPU0:CRS-L(config)#logging  facility     ?
  auth    Authorization system
  cron    Cron/at facility
  daemon  System daemons
  kern    Kernel
  local0  Local use
  local1  Local use
  local2  Local use
  local3  Local use
  local4  Local use
  local5  Local use
  local6  Local use
  local7  Local use
  lpr      Line printer system
  mail    Mail system
  news    USENET news
  sys10   System use
  sys11   System use
  sys12   System use
  sys13   System use
  sys14   Systemcode use
  sys9    System use
  syslog  Syslog itself
  user    User process
  uucp    Unix-to-Unix copy system
  <cr>    
<hostname>

默认传递的syslog 中是不包含设备的hostname的,如下是在log server上记录的log,第一行中不包含hostname; 通过在IOS XR 设备上添加配置”logging hostname <WORD>”可以传递自己自定义的hostname,见第二行输出。

Apr 14 23:34:38 10.1.1.1 462388: LC/0/6/CPU0:Apr 15 09:02:48 : plim_xge[301]: %L2-PLIM-4-XFP_WARN_RX_PWR : Interface TenGigE0/6/0/9, RX Low power warning occurred 
Apr 14 23:50:04 10.1.1.1 462620: CRS-L RP/0/RP0/CPU0:Apr 15 09:18:13 : config[65956]: %MGBL-CONFIG-6-DB_COMMIT : Configuration committed by user 'xuxing'. Use 'show configuration commit changes 1000000229' to view the changes.

TWAMP(Two-Way Active Measurement Protocol,双向主动测量协议)是一种用于IP链路的网络质量测量技术,它使用UDP报文测量网络双向路径时延、抖动及丢包率。TWAMP-light是TWAMP协议的轻量级架构,简化了建立性能测量会话的控制协议,提高了测试性能。

如下TWAMP 与TWAMP light 主要区别在于Twamp 需要先使用TCP建立控制层面。

TWAMP

rfc5357

TWAMP light

rfc5357
Read the rest of this entry »