[mrtg] how to have fix value in mrtg output

Luis Carlos Solano lsolano at racsa.co.cr
Mon Nov 19 05:36:20 CET 2007

Nelson Serafica wrote:
> **Actually, its a simple script. I'm not also a programmer.
> #!/bin/sh
> file=/usr/local/apache2/htdocs/mrtg/clients/Link/
> com2=`cat $file  | egrep "kb/s|b/s" | awk 'NR == 3 {print}' | awk -F\> 
> '{print $2}'  |awk -F\( '{print $1}'`
> com3=`cat $file  | egrep "kb/s|b/s" | awk 'NR == 6 {print}' | awk -F\> 
> '{print $2}'  |awk -F\( '{print $1}'`
my low awk level barely can read your code but, again, my advice would 
be "keep" the kb/s or b/s in com2 and com3 (com2 ends up with something 
like 'b/s 1000' instead of just the number) and then "save" the number 
with the proper scale.

Luis Carlos.

More information about the mrtg mailing list