In sFlow-RT, the only values that are part of the metrics set are those that are received via sFlow, i.e. the ifname and host_name metrics are only available if the agent exports the port_name and host_descr respectively. Now that you have the Host sFlow agent running on your Arista switches you should be seeing the host_name metric.
The sFlow-RT SNMP ifName and sysName are part of the topology functionality and don't generate metrics - setting topology provides a third way to provide port name information to sFlow-RT (1. sFlow structures, 2. SNMP, 3. topology). The following article describes how integrate sFlow-RT with CloudVision and collect topology using eAPI:
Topology information can be accessed in flow definitions using the node: and ifname: functions, e.g. the following flow keys retrieve the sysName and ifName values as part of the flow key:
node:inputifindex,ifname:inputifindex
See the following article for more information on defining flows,
You can also query the topology using functions in the embedded JavaScript API,
For example, the following script periodically queries ifInOctet and ifOutOctet metrics and looks up the corresponding sysName and ifName information:
setTopology({});
setIntervalHandler(function(now) {
var res = table('ALL','ifinoctets,ifoutoctets');
if(!res || res.length == 0) return;
for(var i = 0; i < res.length; i++) {
let entry = res[i];
let { node, port } = topologyInterfaceToPort(entry[0].agent,entry[0].dataSource) || {};
let ifInOctets = entry[0].metricValue || 0;
let ifOutOctets = entry[1].metricValue || 0;
logInfo([node,port,ifInOctets,ifOutOctets]);
}
},10);
The scripting API is useful for pushing metrics to local and cloud based metrics platforms. For example, pushing metrics to InfluxDB:
You can also use eAPI to push automated controls to Arista switches, for example, to mitigate DDoS attacks:
The example above didn't use a port based control, but if you wanted to, you could use the topology queries to get the port name to apply the appropriate configuration command. FYI, the JavaScript, name=ifName(agent,ifIndex), function is a useful shortcut for controller scripts.