The code is as follows:
Url= "/VAR/WWW/HTML/RRA/150/9517.RRD/VAR/WWW/HTML/RRA/256/11345.RRD/VAR/WWW/HTML/RRA/150/9518.RRD" fff= ' echo $url | awk ' {print nf} ' for ((i=1;i<=3;i++)) docriqi= ' date +%s -d ' 2016-04-11 00:00:00 "' eriqi= ' date +%s -d " 2016-04-11 23:59:00 "' ccriqi= ' echo " $ criqi - 86400 * $i "&NBSP;|&NBSP;BC ' eeriqi= ' echo " $eriqi - 86400 * $i "&NBSP;|&NBSP;BC ' dt= ' date -d " 1970-01-01 utc $eeriqi seconds " +%f" for ((x =1;x<= $fff; x + +) douu= ' echo $url | awk -v a=${x} ' {print $a} '/usr/local/ rrdtool/bin/rrdtool fetch $uu MAX --start $ccriqi --end $eeriqi | sed -e '/^$/d ' | grep -v ' traffic_out ' | awk ' {printf "%f\n", "$" | sed ' s/\-nan/0.0000000000e+00/g ' >> /tmp/test${x}done ff= ' Cat /tmp/test1 | wc -l ' for ((n=1 ; n<= $ff; n++)) do for ((y=1;y<= $fff; y++)) do tt= ' Cat /tmp/test${y} | sed -n ${n}p ' echo $tt >> /tmp/fud done aa= ' cat /tmp/fud | awk ' {sum+=$0}END{print sum} ' &Nbsp; re= ' echo ' $aa | awk ' {sum=$0* 8/1000000}end{printf "%.2f", sum} ' echo $re >> /tmp/testz rm -rf /tmp/fud done td= ' cat /tmp/ Testz | sort -nr | sed -n 1p ' if [ ' echo ' $td > 1000 "|BC" -eq 1 ];then tpt= ' echo ' scale=3; $td / 1000 " | bc | awk ' {printf "%.2f ", $ A} ' echo $tpt "G" $DT echo "$TPT" G " $DT" >> /root/qz.txt else echo $td "M" $DT echo "$TD" M " $DT" >> /root/qz.txt fifor ((b=1;b<= $fff; b++)) Dorm &NBSP;-RF&NBSP;/TMP/TEST${B}donerm -rf /tmp/testzdone;
The results of the operation are as follows:
[Email protected]]# sh get_in2.35g 2016-04-103.69g 2016-04-096.84g 2016-04-08[[email protected]]#
Get cacti rrd file daily peak shell