I want to monitor the total traffic usage from a linux server that is running bandwidthd monitoring but I can't think of an easy way to do it.
The bandwidthd program saves an html page every couple of minutes which contains the total traffic value that I'm looking for.
Using cut and similar commands I can get it down to the number, but it's not the bytes number.
e.g. it could be 80K / 80M / 80G / etc.
Extracting the number on it's own then is obviously not useful as getting "80" could mean anything from 80 bytes to 80 terabytes.
Does anyone have a suggestion on how I can extract the size in bytes in order to use it in zabbix?
I've thought of perhaps making a script to take the K/M/G/etc and multiply the number appropriately.
Suggestions?
The bandwidthd program saves an html page every couple of minutes which contains the total traffic value that I'm looking for.
Using cut and similar commands I can get it down to the number, but it's not the bytes number.
e.g. it could be 80K / 80M / 80G / etc.
Extracting the number on it's own then is obviously not useful as getting "80" could mean anything from 80 bytes to 80 terabytes.
Does anyone have a suggestion on how I can extract the size in bytes in order to use it in zabbix?
I've thought of perhaps making a script to take the K/M/G/etc and multiply the number appropriately.
Suggestions?

Comment