I have 3 separate rrd files each with cpu average data. I can graph each individually without issue. cpu average line and trending line (using LSLSLOPE)
I have been asked to combine all three into one graph. so I took my DEF, CEF, and VDEFs and made them with a, b, and c. I must have done something wrong because i am getting the following errors
./graph3avg.sh: line 42: VDEF:avg_a=a,AVERAGE: command not found
./graph3avg.sh: line 59: LINE2:avg_a#f0610f:App CPU Avg:dashes=5: command not found
I was not sure if its a command ordering thing with rrdtool or if i am doing something fundamentally wrong.
Thanks for your time!
here is the rrd command from the shell script
graphname="Server $1 trending"
rrdtool graph $ofile \
--imgformat=PNG \
--alt-autoscale-max \
--start=$starttime \
--end=$endtime \
--title="$graphname" \
--font TITLE:12: \
--units-exponent=2 \
--color CANVAS#ececec \
--vertical-label="CPU %" \
--height=400 \
--width=1000 \
DEF:a="$ifile":cpu:AVERAGE:step=3600 \
DEF:b="$ifile2":cpu:AVERAGE:step=3600 \
DEF:c="$ifile3":cpu:AVERAGE:step=3600 \
VDEF:avg_a=a,AVERAGE \
VDEF:avg_b=b,AVERAGE \
VDEF:avg_c=c,AVERAGE \
VDEF:slope_a=a,LSLSLOPE \
VDEF:slope_b=b,LSLSLOPE \
VDEF:slope_c=c,LSLSLOPE \
VDEF:cons_a=a,LSLINT \
VDEF:cons_b=b,LSLINT \
VDEF:cons_c=c,LSLINT \
CDEF:lsl2_a=a,POP,slope_a,COUNT,*,cons_a,+ \
CDEF:lsl2_b=b,POP,slope_b,COUNT,*,cons_b,+ \
CDEF:lsl2_c=c,POP,slope_c,COUNT,*,cons_c,+ \
LINE2:avg_a#f0610f:"App CPU Avg":dashes=5 \
LINE3:lsl2_a#bd8a6c:"App CPU Trend\n" \
LINE2:avg_b#0ff061:"Web CPU Avg":dashes=5 \
LINE3:lsl2_b#48a068:"Web CPU Trend\n" \
LINE2:avg_c#1fbcd8:"DB CPU Avg":dashes=5 \
LINE3:lsl2_c#619da7:"App CPU Trend\n" \
COMMENT:"\s" \
COMMENT:"Start Date $startdate " \
COMMENT:"End Date $enddate " \
COMMENT:"\n" \
COMMENT:"\n" \
COMMENT:"Graph created on $today"