Use ifSpeed for BANDWIDTH link property


Is it possible somehow to automate link property BANDWIDTH variable to be populated from link ifSpeed data? In case of integration with Cacti.

It is mostly usefull for aggregate links with many members, their count may frequently change from upgrade or temporary absence and correct bandwidth will visualize existing bottleneck.


It is, but only in certain situations. If you use the rrd_use_poller_output feature, or dsstats data sources, then weathermap has enough information to be able to look in the Cacti host_snmp_cache database table and find the ifSpeed. You can find more information in the targets part of the manual: (Cacti poller_output support)

It’s also smart enough to use ifHighSpeed for bigger links.

1 Like

The same kind of thing is possible with DSStats (and there are other benefits to using that) but will need to change all your targets. There is a tool in random-bits/ called convert-to-dsstats.php that can help with part of that process.

One big advantage of DSstats is that you can use its aggregation stats really easily. Just make a second copy of the same map file in the Cacti map list (you need to choose Add, and then show used maps), and for the second copy, add a ‘Map Setting’ variable called dsstats_default_type with a value of (for example) ‘weeklypeak’. Now you have a map showing the peak usage for the last week without needing to manage a second map file. DSStats keeps this data calculated automatically.


Thank you very much!


I don’t use currently Boost or DSStats plugins but rrd_use_poller_output and cacti_use_ifspeed do exactly what i want even without them.
I will install DSStats plugin to check all its cool features.
Thanks again!


Noticed that couple of my links from time to time use incorrect values for bandwidth, can you please recommend how better to debug it, enable weathermap DEBUG log or it is possible to read these ifSpeed or ifHighSpeed values from some cacti mysql table?


The debug logs will show you the raw data coming from rrdtool (unless you switch to poller_output, and then you actually get less information - one of the downsides).

If you add a DATAOUTPUTFILE filename.txt line to your map file in the top section, then you will get a file generated with all the data used in that particular map, updated each time the map is updated (the intended use for this is to allow for ‘summary’ maps that use data from other maps). This is the processed data though, so might not be so useful for fault-finding.


With poller_output, with static bandwidth its pretty straighforward, but with poller_output and cacti_use_ifspeed, not clear how to check which value assigned to specific link if its utilization on scale looks wrong. DATAOUTPUTFILE as i see is same that by default created .result in output directory? But it seems there is no data about ifspeed assigned to specific link.


Oh, I misunderstood… yes, to see the ifSpeed, you’d need to turn on DEBUG logging. It isn’t shown anywhere else.

Well, actually you could also do something like this in the LINK, or LINK DEFAULT:

INBWFORMAT {link:this:max_bandwidth_in:%k}
OUTBWFORMAT {link:this:max_bandwidth_out:%k}

And it will put the maximum values on the link itself, instead of the normal label.

Or even:

INBWFORMAT {link:this:bandwidth_in:%k} / {link:this:max_bandwidth_in:%k}
OUTBWFORMAT {link:this:bandwidth_out:%k} / {link:this:max_bandwidth_out:%k}

To get labels like: “2.4M/10G” on each side (current/max)

Maybe that would help? If you did it in the DEFAULT link, then you can switch it on and off easily by commenting those lines.


Oh yes INBWFORMAT {link:this:max_bandwidth_in:%k} did the trick, thanks!
Now i see ifspeed content. but for some reason shows not correct ifspeed for one link. I need probably to find raw cacti poller data which it collects for this data source, it show correct counters for input/output but ifspeed is wrong.


Weathermap is just grabbing ifSpeed and ifHighSpeed from the cacti snmp cache. And Cacti just grabs those from your device. So if it’s incorrect, that probably your device reporting it incorrectly… (snmpwalk would prove it)


Yes that was my first idea also, but i checked with snmpwalk ifHighSpeed for this port and snmp data from device is correct.


I think i found the reason, it seems ifHighSpeed cached only with SNMP Interface statistics refresh, so if this stats not refreshed for long time they contain outdated data.


That makes sense. I guess I don’t see this issue because our prod Cacti uses a lot of autom8 rules to create graphs as ports are used, so I have a cron process to rescan hosts daily.


I’ll also go to automate re-indexing devices, as it seems they not always re-indexing by index change.