Skip to content

Commit a581924

Browse files
authored
Merge pull request #2 from iotaka/patch-1
Update accounting.sh
2 parents c8329fc + ace899f commit a581924

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

accounting.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,28 @@ DATE=$(date '+%a %b %-d %H\:%M\:%S %Z %Y')
5656
unset datagrups
5757
i=0
5858
for q in $QUEUES; do
59-
datagrups="$datagrups DEF:${q}-used=$RRD_ROOT/qacct_${q}.rrd:${q}-used:AVERAGE LINE1:${q}-used#${COLOR[${i}]}:${q} "
59+
datagrups="$datagrups DEF:${q}-used=$RRD_ROOT/qacct_${q}.rrd:${q}-used:AVERAGE LINE2:${q}-used#${COLOR[${i}]}:${q} "
6060
datagrups="$datagrups GPRINT:${q}-used:MIN:%12.0lf%s"
6161
datagrups="$datagrups GPRINT:${q}-used:MAX:%12.0lf%s"
6262
datagrups="$datagrups GPRINT:${q}-used:AVERAGE:%12.0lf%s\\l"
6363
i=$((i+1))
6464
done
6565

6666
# Queue Waiting
67-
datagrups="$datagrups DEF:slots-qw=$RRD_ROOT/qacct_qw.rrd:slots-qw:AVERAGE LINE1:slots-qw#${COLOR[${i}]}:slots-qw"
67+
datagrups="$datagrups DEF:slots-qw=$RRD_ROOT/qacct_qw.rrd:slots-qw:AVERAGE LINE2:slots-qw#${COLOR[${i}]}:slots-qw"
6868
datagrups="$datagrups GPRINT:slots-qw:MIN:%12.0lf%s"
6969
datagrups="$datagrups GPRINT:slots-qw:MAX:%12.0lf%s"
7070
datagrups="$datagrups GPRINT:slots-qw:AVERAGE:%12.0lf%s\\l"
7171

72-
rrdtool graph $WEB_ROOT/img/hour.png -a PNG -s -1hour -t "HPC Accounting (hourly)" -h 200 -w 600 -v "Used CPU's" COMMENT:" Min Used" COMMENT:" Max Used" COMMENT:" Avg Used \\l" $datagrups COMMENT:"Last update\: $DATE" > /dev/null
72+
HEIGHT=200
73+
WIDTH=600
74+
75+
rrdtool graph $WEB_ROOT/img/hour.png -a PNG -s -1hour -t "HPC Accounting (hourly)" -h $HEIGHT -w $WIDTH -v "Used CPU's" COMMENT:" Min Used" COMMENT:" Max Used" COMMENT:" Avg Used \\l" $datagrups COMMENT:"Last update\: $DATE" > /dev/null
7376

74-
rrdtool graph $WEB_ROOT/img/day.png -a PNG -s -1day -t "HPC Accounting (daily)" -h 200 -w 600 -v "Used CPU's" COMMENT:" Min Used" COMMENT:" Max Used" COMMENT:" Avg Used \\l" $datagrups COMMENT:"Last update\: $DATE" > /dev/null
77+
rrdtool graph $WEB_ROOT/img/day.png -a PNG -s -1day -t "HPC Accounting (daily)" -h $HEIGHT -w $WIDTH -v "Used CPU's" COMMENT:" Min Used" COMMENT:" Max Used" COMMENT:" Avg Used \\l" $datagrups COMMENT:"Last update\: $DATE" > /dev/null
7578

76-
rrdtool graph $WEB_ROOT/img/week.png -a PNG -s -1week -t "HPC Accounting (Weekly)" -h 200 -w 600 -v "Used CPU's" COMMENT:" Min Used" COMMENT:" Max Used" COMMENT:" Avg Used \\l" $datagrups COMMENT:"Last update\: $DATE" > /dev/null
79+
rrdtool graph $WEB_ROOT/img/week.png -a PNG -s -1week -t "HPC Accounting (Weekly)" -h $HEIGHT -w $WIDTH -v "Used CPU's" COMMENT:" Min Used" COMMENT:" Max Used" COMMENT:" Avg Used \\l" $datagrups COMMENT:"Last update\: $DATE" > /dev/null
7780

78-
rrdtool graph $WEB_ROOT/img/month.png -a PNG -s -1month -t "HPC Accounting (Monthly)" -h 200 -w 600 -v "Used CPU's" COMMENT:" Min Used" COMMENT:" Max Used" COMMENT:" Avg Used \\l" $datagrups COMMENT:"Last update\: $DATE" > /dev/null
81+
rrdtool graph $WEB_ROOT/img/month.png -a PNG -s -1month -t "HPC Accounting (Monthly)" -h $HEIGHT -w $WIDTH -v "Used CPU's" COMMENT:" Min Used" COMMENT:" Max Used" COMMENT:" Avg Used \\l" $datagrups COMMENT:"Last update\: $DATE" > /dev/null
7982

80-
rrdtool graph $WEB_ROOT/img/year.png -a PNG -s -1year -t "HPC Accounting (Yearly)" -h 200 -w 600 -v "Used CPU's" COMMENT:" Min Used" COMMENT:" Max Used" COMMENT:" Avg Used \\l" $datagrups COMMENT:"Last update\: $DATE" > /dev/null
83+
rrdtool graph $WEB_ROOT/img/year.png -a PNG -s -1year -t "HPC Accounting (Yearly)" -h $HEIGHT -w $WIDTH -v "Used CPU's" COMMENT:" Min Used" COMMENT:" Max Used" COMMENT:" Avg Used \\l" $datagrups COMMENT:"Last update\: $DATE" > /dev/null

0 commit comments

Comments
 (0)