DamRCorba / huawei_telemetry_sensors

tools to parse telemetry of huawei routers.
MIT License
9 stars 1 forks source link

Input and NE40 config #2

Open jojoflyhigh opened 3 years ago

jojoflyhigh commented 3 years ago

Hello, I've compiled telegraf with your plugins. Can you please gives an example of the telegraf.conf and NE40 associated config.

Thanks for your help. Best Regards

DamRCorba commented 3 years ago

Hi, The telegraf configuration is very simple

###############################################################################
#                            SERVICE INPUT PLUGINS                            #
###############################################################################

# Huawei Routers Telemetry. VRP V8R10
[[inputs.huawei_routers_telemetry]]
  ## UDP Port to capture Telemetry
 service_port = "5600"

And the routers configuration is a little tricky to find, but is simple to implement.

Router Health Example.

<HUAWEI> display current-configuration configuration telemetry
telemetry
 #
 sensor-group RouterHealth
  sensor-path huawei-devm:devm/cpuInfos/cpuInfo
  sensor-path huawei-devm:devm/memoryInfos/memoryInfo
  sensor-path huawei-devm:devm/ports/port/opticalInfo
  sensor-path huawei-devm:devm/powerSupplys/powerSupply/powerEnvironments/powerEnvironment
  sensor-path huawei-devm:devm/temperatureInfos/temperatureInfo
 #
 destination-group huaweiRoutersTelemetryServer
  ipv4-address xxxx port 5600 protocol udp
 #
 subscription huaweiRoutersMetrics
  sensor-group RouterHealth sample-interval 300000
  destination-group huaweiRoutersTelemetryServer
#

The plugin is ready to consume the followings sensors.

<HUAWEI>display telemetry sensor-path
Sample(S) : Serial sample.
Sample(P) : Parallel sample.
Parallel sampled data may not be sent through UDP in out-of-band mode.
------------------------------------------------------------------------------------------------------------------
Type        MinPeriod(ms)  MaxEachPeriod  Path      
------------------------------------------------------------------------------------------------------------------
Event       --             --             huawei-bfd:hwBfdSessDown
Event       --             --             huawei-bfd:hwBfdSessUp
Alarm       --             --             huawei-bgp:BACKWARD
Alarm       --             --             huawei-bgp:ESTABLISHED
OnChange    --             --             huawei-braspppoxaccess:braspppoxaccess/brasPppoeUserDelays/brasPppoeUserDelay
OnChange    --             --             huawei-brasusermng:brasusermng/aaaIncrementShowUserInfomations/aaaIncrementShowUserInfomation
OnChange    --             --             huawei-brasusermng:brasusermng/aaaOfflineRecordTables/aaaOfflineRecordTable
OnChange    --             --             huawei-brasusermng:brasusermng/aaaOnlineFailReasonTables/aaaOnlineFailReasonTable
OnChange    --             --             huawei-brasusermng:brasusermng/aaaShowUserInformations/aaaShowUserInformation
Sample(S)   10000          --             huawei-devm:devm/cpuInfos/cpuInfo
Sample(S)   300000         --             huawei-devm:devm/fans/fan
Sample(S)   10000          --             huawei-devm:devm/memoryInfos/memoryInfo
Sample(S)   300000         --             huawei-devm:devm/ports/port
Sample(S)   300000         --             huawei-devm:devm/ports/port/opticalInfo
Sample(S)   300000         --             huawei-devm:devm/powerSupplys/powerSupply/powerEnvironments/powerEnvironment
Sample(S)   300000         --             huawei-devm:devm/temperatureInfos/temperatureInfo
Alarm       --             --             huawei-driver:hwEntityInvalid
Alarm       --             --             huawei-driver:hwEntityResume
Alarm       --             --             huawei-driver:hwOpticalInvalid
Alarm       --             --             huawei-driver:hwOpticalInvalidResume
Sample(P)   300000         --             huawei-emdi:emdi/emdiTelemReps/emdiTelemRep
Sample(P)   10000          --             huawei-emdi:emdi/emdiTelemRtps/emdiTelemRtp
Sample(S)   10000          --             huawei-ifm:ifm/interfaces/interface
Sample(P)   100            20             huawei-ifm:ifm/interfaces/interface/ifClearedStat
Sample(S)   10000          --             huawei-ifm:ifm/interfaces/interface/ifDynamicInfo
Sample(P)   100            20             huawei-ifm:ifm/interfaces/interface/ifStatistics
Sample(P)   1000           20             huawei-ifm:ifm/interfaces/interface/ifStatistics/ethPortErrSts
Alarm       --             --             huawei-isiscomm:isisAdjacencyChange
OnChange    --             --             huawei-kpi:kpi/kpiDatas/kpiData
Alarm       --             --             huawei-mpls:Session-Down-MIB
Alarm       --             --             huawei-mpls:Session-Up-MIB
Event       --             --             huawei-mpls:TNLREROUTED
Sample(S)   10000          --             huawei-mpls:mpls/mplsTe/rsvpTeTunnels/rsvpTeTunnel/tunnelPaths/tunnelPath
Alarm       --             --             huawei-ospfv2:ospfNbrStateChange
Alarm       --             --             huawei-ospfv2:ospfVirtNbrStateChange
Alarm       --             --             huawei-ospfv3:ospfv3NbrStateChange
Alarm       --             --             huawei-qos:hwXQoSPortQueueAlarm
Alarm       --             --             huawei-qos:hwXQoSPortQueueAlarmClear
Sample(P)   1000           200            huawei-qos:qos/qosBuffers/qosBuffer
Sample(P)   100            20             huawei-qos:qos/qosIfQoss/qosIfQos/qosPolicyApplys/qosPolicyApply/qosPolicyStats/qosPolicyStat/qosRuleStats/qosRuleStat
Sample(P)   1000           10             huawei-qos:qos/qosPortQueueStatInfos/qosPortQueueStatInfo
Alarm       --             --             huawei-sem:hwCPUUtilizationResume
Alarm       --             --             huawei-sem:hwCPUUtilizationRisingAlarm
Alarm       --             --             huawei-sem:hwStorageUtilizationResume
Alarm       --             --             huawei-sem:hwStorageUtilizationRisingAlarm
Sample(S)   300000         --             huawei-trafficmng:trafficmng/tmSlotSFUs/tmSlotSFU/sfuStatisticss/sfuStatistics
------------------------------------------------------------------------------------------------------------------
jojoflyhigh commented 3 years ago

Thanks I will tests it on next monday. 1) Do you think that it could be possible to have it in dynamic mode i.e. like [input.gnmi] plugins where we define the IP and the path expected? 2) Concerning Warning: Some sampled data may not be sent through UDP in out-of-band mode. For details, see the display telemetry sensor-path command. Parallel sampled data may not be sent through UDP in out-of-band mode. How to monitor for instance : huawei-ifm:ifm/interfaces/interface/ifStatistics which is Sample(P) and then not sent though UDP. Will you plugin will work with GRPC instead of UDP ?

Thanks for your help

DamRCorba commented 3 years ago

I have think a lot about dynamic mode and I can't imagine the advantage. I prefer to make telegraf listen any router and configure the routers with ansible, for example. This is because i am interested in save regular stats for all my networks elements. Why do you want dynamic mode?

In second place, I started a few month ago with GRPC but i am not fully dedicated because i dont have any issue by UDP. With this config i have successfully listen all parallel sensors including Qos, traffic stats with sample-rate of 1000 ms. Its work. I tested the plugin with NE40X-A and NE9000 series. Which router will you use?

jojoflyhigh commented 3 years ago

Hello, After several tests, I did not succeed in starting up telegraf I have :

I have some doubt about [[inputs.huawei_routers_telemetry]] in your example as plugins is called huawei_telemetry_sensors. And even if I changed it to huawei_routers_telemetry, it did not work

2020-10-12T12:53:47Z E! [telegraf] Error running agent: Error loading config file /etc/telegraf/telegraf.conf: Error parsing huawei_routers_telemetry, Undefined but requested input: huawei_routers_telemetry root@282367d070be:~/telegraf# vi /etc/telegraf/telegraf.conf

2020-10-12T12:54:33Z I! Using config file: /etc/telegraf/telegraf.conf 2020-10-12T12:54:33Z E! [telegraf] Error running agent: Error loading config file /etc/telegraf/telegraf.conf: Error parsing huawei_telemetry_sensors, Undefined but requested input: huawei_telemetry_sensors

Thanks for your help.

DamRCorba commented 3 years ago

Hi, I write two github repositories, the one with the plugin is my telegraf fork where the input plugin is placed.

This repository is an external tool which is used by the plugin to understand the routers telemetry. It has the protbuf files and sensor information but is not a plugin itself. I did this separation in order to update sensors without ask for a pull request.

In order to use my plugin build my fork or get the plugin code in that repository.