Telemetry是一项监控设备性能和故障的远程数据采集技术。Telemetry技术一般采用gRPC协议将数据从设备推送给网管的采集器。网络设备和网管系统建立gRPC连接后,网管可以订阅设备上指定业务模块的数据信息。
设备支持以下两种gRPC对接模式:
Dial-in模式:设备作为gRPC服务器,采集器作为gRPC客户端。由采集器主动向设备发起gRPC连接并订阅需要采集的数据信息。
Dial-in模式适用于小规模网络和采集器需要向设备下发配置的场景。
Dial-out模式:设备作为gRPC客户端,采集器作为gRPC服务器。设备主动和采集器建立gRPC连接,将设备上配置的订阅数据推送给采集器。
Dial-out模式适用于网络设备较多的情况下向采集器提供设备数据信息。
Dial-in模式配置较为复杂,对服务器要求较多,下面以Dial-out进行基础配置示例。
基础配置如下,以采集接口netsteam信息示例。
#
grpc enable
#
telemetry
sensor-group Test \\创建监控组
sensor path netstream4/ns4cacheinfo \\可以配置多个采样路径
destination-group collector1 \\网管采集器组
ipv4-address 192.168.1.2 \\具体的网管地址
subscription B \\关联采样路径与网管地址
sensor-group Test sample-interval 10 \\采样周期,按照需求配置
destination-group collector1
#
本地的信息如下:
[ASBR-1]dis ip netstream cache
IP NetStream cache information:
Active flow timeout : 30 min
Inactive flow timeout : 30 sec
Max number of entries : 50000
IP active flow entries : 5
MPLS active flow entries : 0
L2 active flow entries : 0
IPL2 active flow entries : 0
IP flow entries counted : 14
MPLS flow entries counted : 0
L2 flow entries counted : 0
IPL2 flow entries counted : 0
Last statistics resetting time : 02/19/2024 at 09:40:50
IP packet size distribution (46 packets in total):
1-32 64 96 128 160 192 224 256 288 320 352 384 416 448 480
.000 .326 .282 .065 .021 .000 .195 .043 .000 .021 .000 .000 .000 .000 .000
512 544 576 1024 1536 2048 2560 3072 3584 4096 4608 >4608
.000 .000 .000 .000 .043 .000 .000 .000 .000 .000 .000 .000
Protocol Total Packets Flows Packets Active(sec) Idle(sec)
Flows /sec /sec /flow /flow /flow
------------------------------------------------------------------------------
UDP-other 9 0 0 3 5 21
TCP-other 2 0 0 3 0 10
ICMP 2 0 0 5 0 30
UDP-NetBios 1 0 0 21 28 17
Type DstIP(Port) SrcIP(Port) Pro ToS VNI APPID If(Direct) Pkts
DstMAC(VLAN) SrcMAC(VLAN)
TopLblType(IP/MASK) Lbl-Exp-S-List
------------------------------------------------------------------------------
IP 192.168.1.2(500- 192.168.1.1(442- 6 0 N/A 0x826 GE0/0(O) 6
51) 86)
IP 239.255.255.250- 192.168.1.2(653- 17 0 N/A 0x0 GE0/0(I) 4
(1900) 18)
IP 192.168.1.2(500- 192.168.1.1(442- 6 0 N/A 0x826 GE0/0(O) 3
51) 80)
IP 192.168.1.2(500- 192.168.1.1(442- 6 0 N/A 0x826 GE0/0(O) 4
51) 86)
IP 192.168.1.1(442- 192.168.1.2(500- 6 0 N/A 0x826 GE0/0(I) 6
86) 51)
GRPC上报示例:
2024-02-19 09:46:18,598: deviceMsg:
producerName: "H3C"
deviceName: "ASBR-1"
deviceModel: "MSR3610-X1"
deviceIpAddr: "not-config"
eventType: "sample"
deviceSerialNumber: "xxxxxxxxxxxx"
sensorPath: "NETSTREAM4/NS4CacheInfo"
JsonData:
{"Notification": {"Timestamp": "1708335882707", "NETSTREAM4": {"NS4CacheInfo": {"CacheInfo": [{"LipNode": 0, "HashIndex": 22555, "Order": 0, "FlowType": 1, "PacketNum": 3, "IfIndex": 2, "Direction": 0, "SrcAddress": "192.168.1.1", "SrcPort": 44280, "DstAddress": "192.168.1.2", "DstPort": 50051, "Protocol": 6, "Tos": 0, "AppID": 2086}, {"LipNode": 0, "HashIndex": 39571, "Order": 0, "FlowType": 1, "PacketNum": 3, "IfIndex": 2, "Direction": 0, "SrcAddress": "192.168.1.1", "SrcPort": 44286, "DstAddress": "192.168.1.2", "DstPort": 50051, "Protocol": 6, "Tos": 0, "AppID": 2086}, {"LipNode": 0, "HashIndex": 39571, "Order": 1, "FlowType": 1, "PacketNum": 2, "IfIndex": 2, "Direction": 0, "SrcAddress": "192.168.1.1", "SrcPort": 44286, "DstAddress": "192.168.1.2", "DstPort": 50051, "Protocol": 6, "Tos": 0, "AppID": 2086}, {"LipNode": 0, "HashIndex": 56551, "Order": 0, "FlowType": 1, "PacketNum": 3, "IfIndex": 2, "Direction": 1, "SrcAddress": "192.168.1.2", "SrcPort": 50051, "DstAddress": "192.168.1.1", "DstPort": 44286, "Protocol": 6, "Tos": 0, "AppID": 2086}]}}}}
上面是以Json的形式展现的,与本地采样数据对应,数据需要网管软件进行合理展现。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作