Commit 509deb74 authored by 's avatar

git-svn-id: file:///home/svn/mapi/trunk@618 8d5bb341-7cf1-0310-8cf6-ba355fef3186

parent e4eeed93
#!/bin/bash
ABW_DIR=/usr/local/abw
RRD_DIR=/usr/local/abw/rrd
GRAPH_DIR=/usr/local/abw/graph
if [ $# -lt 1 ]; then
echo "Usage: $0 { l4 | apps } [ link_number ]"
exit -1
fi
if [ $1 = "l4" ]; then
GRAPH_SCRIPT=${ABW_DIR}/bin/rrd_graph_l4.sh
elif [ $1 = "apps" ]; then
GRAPH_SCRIPT=${ABW_DIR}/bin/rrd_graph_apps.sh
else
echo "Unknown graph type (only l4 and apps are supported)"
exit -1
fi
echo "GRAPH_SCRIPT: $GRAPH_SCRIPT"
if [ $# -gt 1 ]; then
SUBJECT_SELECTED=$2
else
SUBJECT_SELECTED=-1
fi
echo "SUBJECT_SELECTED: $SUBJECT_SELECTED"
LINK[0]="GN2-CESNET2"
LINK[1]="Prague_PoP"
LINK[2]="Plzen_PoP"
LINK[3]="Ostrava_PoP"
LINK[4]="Liberec_PoP"
LINK[5]="Brno_PoP"
TITLE[0]="GN2-CESNET2"
TITLE[1]="Prague PoP"
TITLE[2]="Plzen PoP"
TITLE[3]="Ostrava PoP"
TITLE[4]="Liberec PoP"
TITLE[5]="Brno PoP"
PREFIX_IN[0]="${RRD_DIR}/jra1-2.cesnet.cz-dev_dag0-0-1"
PREFIX_OUT[0]="${RRD_DIR}/jra1-2.cesnet.cz-dev_dag0-0-1"
PREFIX_IN[1]="${RRD_DIR}/perfmon1.cesnet.cz-eth1-0-1"
PREFIX_OUT[1]="${RRD_DIR}/perfmon1.cesnet.cz-eth2-0-1"
PREFIX_IN[2]="${RRD_DIR}/perfmon-plzen.cesnet.cz-eth1-0-1"
PREFIX_OUT[2]="${RRD_DIR}/perfmon-plzen.cesnet.cz-eth2-0-1"
PREFIX_IN[3]="${RRD_DIR}/perfmon-ostrava.cesnet.cz-eth1-0-1"
PREFIX_OUT[3]="${RRD_DIR}/perfmon-ostrava.cesnet.cz-eth2-0-1"
PREFIX_IN[4]="${RRD_DIR}/perfmon-liberec.cesnet.cz-eth1-0-1"
PREFIX_OUT[4]="${RRD_DIR}/perfmon-liberec.cesnet.cz-eth2-0-1"
PREFIX_IN[5]="${RRD_DIR}/perfmon2.cesnet.cz-eth1-0-1"
PREFIX_OUT[5]="${RRD_DIR}/perfmon2.cesnet.cz-eth1-0-1"
CURRENT_MIN=`date +%M`
CURRENT_HOUR=`date +%H`
CURRENT_DAY=`date +%Y%m%d`
CURRENT_10MIN=`expr $CURRENT_MIN / 10 \* 10`
CURRENT_5HOUR=`expr $CURRENT_HOUR / 5 \* 5`
rm -f $GRAPH_DIR/graph*
for (( I=0 ; ${#LINK[$I]} > 0 ; I++ )) ; do
echo "Link number: $I"
echo "Link name: ${LINK[$I]}"
echo "Title: ${TITLE[$I]}"
if [ $SUBJECT_SELECTED -lt 0 -o $SUBJECT_SELECTED -eq $I ]; then
echo "generate graphs for this subject"
# Resolution 1
${GRAPH_SCRIPT} ${PREFIX_IN[$I]} ${PREFIX_OUT[$I]} \
${GRAPH_DIR}/graph_${LINK[$I]}_l4_1s_60s_10min.png \
"end-10min" "${CURRENT_HOUR}:${CURRENT_MIN} ${CURRENT_DAY}" \
1 60 "${TITLE[$I]}"
${GRAPH_SCRIPT} ${PREFIX_IN[$I]} ${PREFIX_OUT[$I]} \
${GRAPH_DIR}/graph_${LINK[$I]}_l4_1s_60s_60min.png \
"end-60min" "${CURRENT_HOUR}:${CURRENT_MIN} ${CURRENT_DAY}" \
1 60 "${TITLE[$I]}"
# Resolution 2
${GRAPH_SCRIPT} ${PREFIX_IN[$I]} ${PREFIX_OUT[$I]} \
${GRAPH_DIR}/graph_${LINK[$I]}_l4_10s_600s_5h.png \
"end-5h" "${CURRENT_HOUR}:${CURRENT_10MIN} ${CURRENT_DAY}" \
1 60 "${TITLE[$I]}"
${GRAPH_SCRIPT} ${PREFIX_IN[$I]} ${PREFIX_OUT[$I]} \
${GRAPH_DIR}/graph_${LINK[$I]}_l4_10s_600s_1day.png \
"end-1day" "${CURRENT_HOUR}:${CURRENT_10MIN} ${CURRENT_DAY}" \
1 60 "${TITLE[$I]}"
# Resolution 3
${GRAPH_SCRIPT} ${PREFIX_IN[$I]} ${PREFIX_OUT[$I]} \
${GRAPH_DIR}/graph_${LINK[$I]}_l4_60s_3600s_1day.png \
"end-1day" "${CURRENT_HOUR}:00 ${CURRENT_DAY}" \
1 60 "${TITLE[$I]}"
${GRAPH_SCRIPT} ${PREFIX_IN[$I]} ${PREFIX_OUT[$I]} \
${GRAPH_DIR}/graph_${LINK[$I]}_l4_60s_3600s_1week.png \
"end-1week" "${CURRENT_HOUR}:00 ${CURRENT_DAY}" \
1 60 "${TITLE[$I]}"
# Resolution 4
${GRAPH_SCRIPT} ${PREFIX_IN[$I]} ${PREFIX_OUT[$I]} \
${GRAPH_DIR}/graph_${LINK[$I]}_l4_3600s_3600s_1month.png \
"end-1month" "${CURRENT_HOUR}:00 ${CURRENT_DAY}" \
1 60 "${TITLE[$I]}"
${GRAPH_SCRIPT} ${PREFIX_IN[$I]} ${PREFIX_OUT[$I]} \
${GRAPH_DIR}/graph_${LINK[$I]}_l4_3600s_3600s_1year.png \
"end-1year" "${CURRENT_HOUR}:00 ${CURRENT_DAY}" \
1 60 "${TITLE[$I]}"
else
echo "DO NOT generate graphs for this subject"
fi
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment