Sflow Ethernet port metrics

264 views
Skip to first unread message

Akshay Bijapur

unread,
Sep 25, 2018, 7:55:21 PM9/25/18
to sFlow-RT
My Implementation deals with an Arista switch sending Sflow data to a host system, the implementation was based on the link below


I am successful in implementing the Sflow-RT as shown in the link


My goal is to push data into InfluxDB and display in Grafana by grouping under Interface port or CPU core

However, while gathering metrics, I observed that there were no values on per CPU/ ethernet port basis. The example in the link shows how to get CPU total metrics but not per core basis.

What are the metrics in Sflow or Sflow RT of individual "CPU core" or individual "Ethernet Port"?


Thanks, 
Akshay

Peter Phaal

unread,
Sep 26, 2018, 2:32:52 PM9/26/18
to sFlow-RT
The sFlow Host Structures (https://sflow.org/sflow_host.txt) defines the standard set of metrics exported by the Host sFlow agent. The sFlow-RT names for the metrics are listed on the web site:

The host metrics summarize overall performance of the host and don't provide per core, disk, adapter metrics.

Per interface counters are exported by the sFlow agent embedded in EOS. The per interface counters are described in the sFlow Version 5 spec (https://sflow.org/sflow_version_5.txt) and are the sFlow-RT names are listed on the web site:

The script in https://blog.sflow.com/2017/01/telegraf-influxdb-chronograf-and.html can be modified to include per interface counter export to InfluxDB. Just add the following lines immediately before the sendToInfluxDB(msg) line.

  // Telegraf Net plugin metrics

  // https://github.com/influxdata/telegraf/blob/master/plugins/inputs/net/NET_README.md

  // need to enable SNMP (-Dsnmp.ifname=yes) if ifname values are not exported by sFlow agent

  var hostname,ifiname;

  vals = table('ALL','ifindex,ifinoctets,ifoutoctets,ifinpkts,ifoutpkts,ifindiscards,ifoutdiscards,ifinerrors,ifouterrors');

  for(i = 0; i < vals.length; i++) {

    r = vals[i];

    hostname = metric(r[0].agent,"host_name")[0].metricValue;

    if(!hostname) continue;

    ifname = ifName(r[0].agent,r[0].metricValue);

    if(!ifname) continue;

    msg.push('net,interface='+ifname+',host='+hostname

      + ' bytes_sent='+(r[1].metricValue||0)

      + ',bytes_recv='+(r[2].metricValue||0)

      + ',packets_sent='+(r[3].metricValue||0)

      + ',packets_recv='+(r[4].metricValue||0)

      + ',err_in='+(r[5].metricValue||0)

      + ',err_out='+(r[6].metricValue||0)

      + ',drop_in='+(r[7].metricValue||0)

      + ',drop_out='+(r[8].metricValue||0));

  }


EOS does not currently include ifname information with the interface counters (using the port_name structure specified in https://sflow.org/sflow_openflow.txt). You can set the sFlow-RT system property (https://sflow-rt.com/reference.php#properties), snmp.ifname=yes to get sFlow-RT to automatically retrieve ifName values using SNMP. You may also need to set additional properties for community string etc.


Reply all
Reply to author
Forward
0 new messages