Aggregate / consolidated graph of many links
Posted: Mon Mar 02, 2015 2:33 pm
Dear Forum/Expert
We were looking for long time as a single combined one utilization (performance) graph of many links. Me tried as below and its okay for us. If there is valuable feedback, most welcome.
FYI, the main three lines from check_rrdtraf
Its very basic just first level (me not an expert) and looking forward from NagiosXI to add as a robust feature.
As this is Host independent, can be added as a Service under any Host.
more /usr/local/nagios/libexec/all_stm16_bw
#!/bin/sh
let TOTALIN=0;TOTALOUT=0
fetchinoutval ()
{
DATASET=`rrdtool fetch $FILE AVERAGE -s-10minutes| grep -vi "nan"`
VALUEIN=`echo "$DATASET" | awk '{x=$2} END { printf("%f\n", x * 8) }'`
VALUEOUT=`echo "$DATASET" | awk '{x=$3} END { printf("%f\n", x * 8) }'`
TOTALIN=`echo $TOTALIN+$VALUEIN | bc`
TOTALOUT=`echo $TOTALOUT+$VALUEOUT | bc`
}
FILE="/var/lib/mrtg/lon-jnpr_111.rrd"
fetchinoutval
FILE="/var/lib/mrtg/tok-7600_222.rrd"
fetchinoutval
FILE="/var/lib/mrtg/nyc-jnpr_333.rrd"
fetchinoutval
TOTALIN=`echo "scale=3;$TOTALIN/1000000000" | bc -l`
TOTALOUT=`echo "scale=3;$TOTALOUT/1000000000" | bc -l`
echo ""Gb:In/Out = $TOTALIN / $TOTALOUT" | InGbps=$TOTALIN OutGbps=$TOTALOUT"
exit
Regards
We were looking for long time as a single combined one utilization (performance) graph of many links. Me tried as below and its okay for us. If there is valuable feedback, most welcome.
FYI, the main three lines from check_rrdtraf
Its very basic just first level (me not an expert) and looking forward from NagiosXI to add as a robust feature.
As this is Host independent, can be added as a Service under any Host.
more /usr/local/nagios/libexec/all_stm16_bw
#!/bin/sh
let TOTALIN=0;TOTALOUT=0
fetchinoutval ()
{
DATASET=`rrdtool fetch $FILE AVERAGE -s-10minutes| grep -vi "nan"`
VALUEIN=`echo "$DATASET" | awk '{x=$2} END { printf("%f\n", x * 8) }'`
VALUEOUT=`echo "$DATASET" | awk '{x=$3} END { printf("%f\n", x * 8) }'`
TOTALIN=`echo $TOTALIN+$VALUEIN | bc`
TOTALOUT=`echo $TOTALOUT+$VALUEOUT | bc`
}
FILE="/var/lib/mrtg/lon-jnpr_111.rrd"
fetchinoutval
FILE="/var/lib/mrtg/tok-7600_222.rrd"
fetchinoutval
FILE="/var/lib/mrtg/nyc-jnpr_333.rrd"
fetchinoutval
TOTALIN=`echo "scale=3;$TOTALIN/1000000000" | bc -l`
TOTALOUT=`echo "scale=3;$TOTALOUT/1000000000" | bc -l`
echo ""Gb:In/Out = $TOTALIN / $TOTALOUT" | InGbps=$TOTALIN OutGbps=$TOTALOUT"
exit
Regards