Commit 69644079 authored by 's avatar

Bug fixes


git-svn-id: file:///home/svn/mapi/trunk@778 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent b1b197df
...@@ -75,11 +75,25 @@ $subject_hostname=array( ...@@ -75,11 +75,25 @@ $subject_hostname=array(
/* /*
* Predefined time intervals and granularities * Predefined time intervals and granularities
*
* Keep in mind the following requirements:
*
* - each resolution must be >= time of one pixel on X axis
* (set in rrd_graph_all.sh) otherwise time of one pixel is used
*
* - UNIX timestamps of both start time and end time must be multiples
* of both resolutions (set time_length accordingly and compute
* end time to be on boundary) and it is safer to skip the most recent
* samples, see variable $hhmmYYYYMMDD below
*
* - RRD files must include RRA samples for the whole requested period,
* create RRD files to include enough RRA samples for possible browsing
* in time axis
*/ */
$time_description[0]="last 10 mins (interval 1 sec, avg/max 30 sec)"; $time_description[0]="last 10 mins (interval 1 sec, avg/max 30 sec)";
$time_description[1]="last 1 hour (interval 6 sec, avg/max 3 min)"; $time_description[1]="last 1 hour (interval 10 sec, avg/max 3 min)";
$time_description[2]="last 6 hours (interval 36 sec, avg/max 20 min)"; $time_description[2]="last 10 hours (interval 1 min, avg/max 20 min)";
$time_description[3]="last 1 day (interval 3 min, avg/max 1 hour)"; $time_description[3]="last 1 day (interval 3 min, avg/max 1 hour)";
$time_description[4]="last 1 week (interval 20 min, avg/max 6 hour)"; $time_description[4]="last 1 week (interval 20 min, avg/max 6 hour)";
$time_description[5]="last 1 month (interval 3 hour, avg/max 1 day)"; $time_description[5]="last 1 month (interval 3 hour, avg/max 1 day)";
...@@ -89,13 +103,13 @@ $r1[0]=1; ...@@ -89,13 +103,13 @@ $r1[0]=1;
$r2[0]=30; $r2[0]=30;
$time_length[0]="10min"; $time_length[0]="10min";
$r1[1]=6; $r1[1]=10;
$r2[1]=180; $r2[1]=180;
$time_length[1]="1h"; $time_length[1]="1h";
$r1[2]=36; $r1[2]=60;
$r2[2]=1200; $r2[2]=1200;
$time_length[2]="6h"; $time_length[2]="10h";
$r1[3]=180; $r1[3]=180;
$r2[3]=3600; $r2[3]=3600;
...@@ -195,9 +209,19 @@ foreach ($subject_label as $key => $value) { ...@@ -195,9 +209,19 @@ foreach ($subject_label as $key => $value) {
echo "</tr>\n"; echo "</tr>\n";
$i++; $i++;
} }
if (($i%2)==0)
echo "<tr>\n";
echo "<td>all subjects</td>\n";
echo "<td><input type=checkbox name=\"subject_all\"";
if ($subject_all)
echo " checked";
echo "></td>\n";
$i++;
if (($i%2)>0) if (($i%2)>0)
echo "<td>&nbsp;</td><td>&nbsp;</td>"; echo "<td>&nbsp;</td><td>&nbsp;</td>";
echo "</table>\n"; echo "</tr></table>\n";
/* /*
* Print form to select time granularities and periods * Print form to select time granularities and periods
...@@ -217,14 +241,14 @@ foreach ($time_description as $key => $value) { ...@@ -217,14 +241,14 @@ foreach ($time_description as $key => $value) {
$time_label=$r1[$key] . "_" . $r2[$key] . "_" . $time_length[$key]; $time_label=$r1[$key] . "_" . $r2[$key] . "_" . $time_length[$key];
echo "<td><input type=checkbox name=\"times[]\" value=\"" . $time_label . "\""; echo "<td><input type=checkbox name=\"times[]\" value=\"" . $time_label . "\"";
if (isset($times)) { if (isset($times)) {
if (in_array($time_label, $times) || $time_all) if (in_array($time_label, $times))
echo " checked"; echo " checked";
} }
echo "></td>\n"; echo "></td>\n";
echo "</tr>\n"; echo "</tr>\n";
} }
echo "<tr>\n"; echo "<tr>\n";
echo "<td>all</td>\n"; echo "<td>all predefined time periods</td>\n";
echo "<td><input type=checkbox name=\"time_all\""; echo "<td><input type=checkbox name=\"time_all\"";
if ($time_all) if ($time_all)
echo " checked"; echo " checked";
...@@ -307,7 +331,8 @@ echo "</form><br>\n"; ...@@ -307,7 +331,8 @@ echo "</form><br>\n";
if ($action=="gen_graph") { if ($action=="gen_graph") {
$hhmmYYYYMMDD=date("G:i Ymd"); $current_time=date("G:i:s Ymd", time());
echo "current_time: $current_time<br>\n";
foreach (glob(GRAPH_DIR . "/*") as $filename) foreach (glob(GRAPH_DIR . "/*") as $filename)
unlink($filename); unlink($filename);
...@@ -315,7 +340,9 @@ if ($action=="gen_graph") { ...@@ -315,7 +340,9 @@ if ($action=="gen_graph") {
/* If at least one graph type, one subject and one time period were /* If at least one graph type, one subject and one time period were
selected, then generate and show graphs */ selected, then generate and show graphs */
if (isset($graph_types) && isset($subjects) && isset($times)) { if (isset($graph_types) &&
(isset($subjects) || $subject_all) &&
(isset($times) || $time_all)) {
/* Go over all selected graph types */ /* Go over all selected graph types */
...@@ -326,7 +353,9 @@ if ($action=="gen_graph") { ...@@ -326,7 +353,9 @@ if ($action=="gen_graph") {
$i=0; $i=0;
foreach ($subject_label as $subject_key => $subject_value) { foreach ($subject_label as $subject_key => $subject_value) {
if (in_array($subject_value, $subjects)) { if (($subject_all || in_array($subject_value, $subjects)) &&
!$subject_disabled[$subject_key]) {
$hostname=$subject_hostname[$i]; $hostname=$subject_hostname[$i];
$command="ssh " . REMOTE_USERNAME . "@" . $subject_hostname[$i] . $command="ssh " . REMOTE_USERNAME . "@" . $subject_hostname[$i] .
...@@ -339,6 +368,9 @@ if ($action=="gen_graph") { ...@@ -339,6 +368,9 @@ if ($action=="gen_graph") {
$time_label=$r1[$time_key] . "_" . $r2[$time_key] . "_" . $time_label=$r1[$time_key] . "_" . $r2[$time_key] . "_" .
$time_length[$time_key]; $time_length[$time_key];
if ($time_all || in_array($time_label, $times)) { if ($time_all || in_array($time_label, $times)) {
$hhmmYYYYMMDD=date("G:i Ymd", (int)(time() / $r2[$time_key]) * $r2[$time_key] - $r2[$time_key]);
echo "r2: $r2[$time_key], hhmmYYMMDD: $hhmmYYYYMMDD<br>\n";
$command=$command . " --time=\\\"" . $command=$command . " --time=\\\"" .
$r1[$time_key] . " " . $r2[$time_key] . " " . $r1[$time_key] . " " . $r2[$time_key] . " " .
$time_length[$time_key] . " " . $hhmmYYYYMMDD . "\\\""; $time_length[$time_key] . " " . $hhmmYYYYMMDD . "\\\"";
...@@ -362,7 +394,8 @@ if ($action=="gen_graph") { ...@@ -362,7 +394,8 @@ if ($action=="gen_graph") {
foreach($graph_types as $graph_type) { foreach($graph_types as $graph_type) {
foreach ($subject_label as $subject_key => $subject_value) { foreach ($subject_label as $subject_key => $subject_value) {
if (in_array($subject_value, $subjects)) { if (($subject_all || in_array($subject_value, $subjects)) &&
!$subject_disabled[$subject_key]) {
foreach ($time_description as $time_key => $time_value) { foreach ($time_description as $time_key => $time_value) {
$time_label=$r1[$time_key] . "_" . $r2[$time_key] . "_" . $time_label=$r1[$time_key] . "_" . $r2[$time_key] . "_" .
$time_length[$time_key]; $time_length[$time_key];
...@@ -399,7 +432,7 @@ if ($action=="gen_graph") { ...@@ -399,7 +432,7 @@ if ($action=="gen_graph") {
echo "</table>\n"; echo "</table>\n";
} /* if (isset($graph_types) && isset($subjects) && isset($times) */ } /* if (isset($graph_types) && ... */
} /* if ($action=="gen_graph") */ } /* if ($action=="gen_graph") */
......
...@@ -4,9 +4,11 @@ if [ $# != 1 ]; then ...@@ -4,9 +4,11 @@ if [ $# != 1 ]; then
fi fi
# Keep 1 second averages for 3 hours # Keep 1 second averages for 3 hours
# 10 second 1 day # 10 second 2 days
# 30 second 2 days
# 60 second 2 weeks # 60 second 2 weeks
# 300 second 2 weeks # 180 second 2 weeks
# 600 second 2 months
# 1 hour 2 years # 1 hour 2 years
rm -f $1 rm -f $1
...@@ -14,17 +16,23 @@ rrdtool create $1 --start 0 --step 1 \ ...@@ -14,17 +16,23 @@ rrdtool create $1 --start 0 --step 1 \
DS:packets:GAUGE:5:U:U \ DS:packets:GAUGE:5:U:U \
DS:bytes:GAUGE:5:U:U \ DS:bytes:GAUGE:5:U:U \
DS:mbps:GAUGE:5:U:U \ DS:mbps:GAUGE:5:U:U \
RRA:AVERAGE:0:1:600 \ RRA:AVERAGE:0:1:7200 \
RRA:AVERAGE:0.5:10:600 \ RRA:AVERAGE:0.5:10:17280 \
RRA:AVERAGE:0.5:60:600 \ RRA:AVERAGE:0.5:30:5760 \
RRA:AVERAGE:0.5:600:600 \ RRA:AVERAGE:0.5:60:20160 \
RRA:AVERAGE:0.5:3600:600 \ RRA:AVERAGE:0.5:180:6720 \
RRA:MIN:0.5:10:600 \ RRA:AVERAGE:0.5:600:8640 \
RRA:MIN:0.5:60:600 \ RRA:AVERAGE:0.5:3600:17520 \
RRA:MIN:0.5:600:600 \ RRA:MIN:0.5:10:17280 \
RRA:MIN:0.5:3600:600 \ RRA:MIN:0.5:30:5760 \
RRA:MAX:0.5:10:600 \ RRA:MIN:0.5:60:20160 \
RRA:MAX:0.5:60:600 \ RRA:MIN:0.5:180:6720 \
RRA:MAX:0.5:600:600 \ RRA:MIN:0.5:600:8640 \
RRA:MAX:0.5:3600:600 RRA:MIN:0.5:3600:1752 \
RRA:MAX:0.5:10:17280 \
RRA:MAX:0.5:30:5760 \
RRA:MAX:0.5:60:20160 \
RRA:MAX:0.5:180:6720 \
RRA:MAX:0.5:600:8640 \
RRA:MAX:0.5:3600:17520
...@@ -6,6 +6,8 @@ GRAPH_DIR=/usr/local/abw/graph ...@@ -6,6 +6,8 @@ GRAPH_DIR=/usr/local/abw/graph
ABW_INFO_COMMAND=${ABW_DIR}/bin/abw_info ABW_INFO_COMMAND=${ABW_DIR}/bin/abw_info
ABW_CONF=${ABW_DIR}/etc/abw.cfg ABW_CONF=${ABW_DIR}/etc/abw.cfg
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
usage() { usage() {
echo "Usage: $0 [ -r ] \\" echo "Usage: $0 [ -r ] \\"
echo " --protocols={l4|apps} \\" echo " --protocols={l4|apps} \\"
...@@ -155,9 +157,10 @@ for (( I=0 ; $I<$SUBJECT_LABEL_NO ; I++ )) ; do ...@@ -155,9 +157,10 @@ for (( I=0 ; $I<$SUBJECT_LABEL_NO ; I++ )) ; do
echo -n "Generating graphs for subject_id/label" echo -n "Generating graphs for subject_id/label"
echo " ${SUBJECT_ID[$I]}/${LABEL[$I]} and parameters_id ${PARAMETERS_ID[$I]}" echo " ${SUBJECT_ID[$I]}/${LABEL[$I]} and parameters_id ${PARAMETERS_ID[$I]}"
################################################### ############################################################################
### If --subject_id was specified (not --label) ### ### If --subject_id was specified (not --label), then a single graph for ###
################################################### ### one direction of traffic will be generated ###
############################################################################
if [ ${SUBJECT_ID[$I]} -gt 0 ]; then if [ ${SUBJECT_ID[$I]} -gt 0 ]; then
...@@ -195,9 +198,10 @@ for (( I=0 ; $I<$SUBJECT_LABEL_NO ; I++ )) ; do ...@@ -195,9 +198,10 @@ for (( I=0 ; $I<$SUBJECT_LABEL_NO ; I++ )) ; do
echo "LABEL: $LABEL" echo "LABEL: $LABEL"
echo "DESCRIPTION: $DESCRIPTION" echo "DESCRIPTION: $DESCRIPTION"
################################################### ##########################################################################
### If --label was specified (not --subject_id) ### ### If --label was specified (not --subject_id), then a dual graph for ###
################################################### ### both directions of traffic will be generated ###
##########################################################################
else else
...@@ -215,60 +219,56 @@ for (( I=0 ; $I<$SUBJECT_LABEL_NO ; I++ )) ; do ...@@ -215,60 +219,56 @@ for (( I=0 ; $I<$SUBJECT_LABEL_NO ; I++ )) ; do
echo "command: $COMMAND" echo "command: $COMMAND"
MEASUREMENT_ARRAY_OUT=(`$COMMAND`) MEASUREMENT_ARRAY_OUT=(`$COMMAND`)
if [ "${MEASUREMENT_ARRAY_IN[0]}" = "unknown" -a "${MEASUREMENT_ARRAY_OUT[0]}" = "unknown" ]; then if [ ${MEASUREMENT_ARRAY_IN[0]} = "unknown" -a ${MEASUREMENT_ARRAY_OUT[0]} = "unknown" ]; then
echo "Unknown label or parameters_id" echo "Unknown label or parameters_id"
exit -1 exit -1
fi fi
if [ "${MEASUREMENT_ARRAY_IN[0]}" != "unknown" ]; then HOSTNAME_IN=${MEASUREMENT_ARRAY_IN[0]}
HOSTNAME_IN=${MEASUREMENT_ARRAY_IN[0]} INTERFACE_IN=${MEASUREMENT_ARRAY_IN[1]}
INTERFACE_IN=${MEASUREMENT_ARRAY_IN[1]} PREFIX_IN=${MEASUREMENT_ARRAY_IN[2]}
PREFIX_IN=${MEASUREMENT_ARRAY_IN[2]} LABEL_IN=${MEASUREMENT_ARRAY_IN[3]}
LABEL_IN=${MEASUREMENT_ARRAY_IN[3]}
DESCRIPTION_IN=${MEASUREMENT_ARRAY_IN[4]}
J=5
END=0
while [ $J -lt ${#MEASUREMENT_ARRAY_IN[*]} -a $END -eq 0 ]; do
DESCRIPTION_IN="$DESCRIPTION_IN ${MEASUREMENT_ARRAY_IN[$J]}"
if [ "${MEASUREMENT_ARRAY_IN[$J]: -1}" = "\"" ]; then
END=1
fi
J=`expr $J + 1`
done
DESCRIPTION_IN=${DESCRIPTION_IN:1:${#DESCRIPTION_IN}-2}
echo "HOSTNAME_IN: $HOSTNAME_IN"
echo "INTERFACE_IN: $INTERFACE_IN"
echo "PREFIX_IN: $PREFIX_IN"
echo "LABEL_IN: $LABEL_IN"
echo "DESCRIPTION_IN: $DESCRIPTION_IN"
fi
if [ "${MEASUREMENT_ARRAY_OUT[0]}" != "unknown" ]; then HOSTNAME_OUT=${MEASUREMENT_ARRAY_OUT[0]}
HOSTNAME_OUT=${MEASUREMENT_ARRAY_OUT[0]} INTERFACE_OUT=${MEASUREMENT_ARRAY_OUT[1]}
INTERFACE_OUT=${MEASUREMENT_ARRAY_OUT[1]} PREFIX_OUT=${MEASUREMENT_ARRAY_OUT[2]}
PREFIX_OUT=${MEASUREMENT_ARRAY_OUT[2]} LABEL_OUT=${MEASUREMENT_ARRAY_OUT[3]}
LABEL_OUT=${MEASUREMENT_ARRAY_OUT[3]}
DESCRIPTION_IN=${MEASUREMENT_ARRAY_IN[4]}
DESCRIPTION_OUT=${MEASUREMENT_ARRAY_OUT[4]} J=5
J=5 END=0
END=0 while [ $J -lt ${#MEASUREMENT_ARRAY_IN[*]} -a $END -eq 0 ]; do
while [ $J -lt ${#MEASUREMENT_ARRAY_OUT[*]} -a $END -eq 0 ]; do DESCRIPTION_IN="$DESCRIPTION_IN ${MEASUREMENT_ARRAY_IN[$J]}"
DESCRIPTION_OUT="$DESCRIPTION_OUT ${MEASUREMENT_ARRAY_OUT[$J]}" if [ "${MEASUREMENT_ARRAY_IN[$J]: -1}" = "\"" ]; then
if [ "${MEASUREMENT_ARRAY_OUT[$J]: -1}" = "\"" ]; then END=1
END=1 fi
fi J=`expr $J + 1`
J=`expr $J + 1` done
done DESCRIPTION_IN=${DESCRIPTION_IN:1:${#DESCRIPTION_IN}-2}
DESCRIPTION_OUT=${DESCRIPTION_OUT:1:${#DESCRIPTION_OUT}-2}
DESCRIPTION_OUT=${MEASUREMENT_ARRAY_OUT[4]}
echo "HOSTNAME_OUT: $HOSTNAME_OUT" J=5
echo "INTERFACE_OUT: $INTERFACE_OUT" END=0
echo "PREFIX_OUT: $PREFIX_OUT" while [ $J -lt ${#MEASUREMENT_ARRAY_OUT[*]} -a $END -eq 0 ]; do
echo "LABEL_OUT: $LABEL_OUT" DESCRIPTION_OUT="$DESCRIPTION_OUT ${MEASUREMENT_ARRAY_OUT[$J]}"
echo "DESCRIPTION_OUT: $DESCRIPTION_OUT" if [ "${MEASUREMENT_ARRAY_OUT[$J]: -1}" = "\"" ]; then
fi END=1
fi
J=`expr $J + 1`
done
DESCRIPTION_OUT=${DESCRIPTION_OUT:1:${#DESCRIPTION_OUT}-2}
echo "HOSTNAME_IN: $HOSTNAME_IN"
echo "INTERFACE_IN: $INTERFACE_IN"
echo "PREFIX_IN: $PREFIX_IN"
echo "LABEL_IN: $LABEL_IN"
echo "DESCRIPTION_IN: $DESCRIPTION_IN"
echo "HOSTNAME_OUT: $HOSTNAME_OUT"
echo "INTERFACE_OUT: $INTERFACE_OUT"
echo "PREFIX_OUT: $PREFIX_OUT"
echo "LABEL_OUT: $LABEL_OUT"
echo "DESCRIPTION_OUT: $DESCRIPTION_OUT"
fi fi
...@@ -300,17 +300,13 @@ for (( I=0 ; $I<$SUBJECT_LABEL_NO ; I++ )) ; do ...@@ -300,17 +300,13 @@ for (( I=0 ; $I<$SUBJECT_LABEL_NO ; I++ )) ; do
if [ ${SUBJECT_ID[$I]} -gt 0 ]; then if [ ${SUBJECT_ID[$I]} -gt 0 ]; then
COMMAND="$COMMAND ${PREFIX[$I]} \"\"" COMMAND="$COMMAND ${PREFIX[$I]} \"\""
else else
COMMAND="$COMMAND \"${PREFIX_IN[$I]}\" \"${PREFIX_OUT[$I]}\"" COMMAND="$COMMAND ${PREFIX_IN[$I]} ${PREFIX_OUT[$I]}"
fi fi
COMMAND="$COMMAND ${GRAPH_DIR}/graph_${LABEL[$I]}_${GRAPH_TYPE}_${R1}s_${R2}s_${TIME_LENGTH}.png end-${TIME_LENGTH} \"${END_TIME}\" ${R1} ${R2}" COMMAND="$COMMAND ${GRAPH_DIR}/graph_${LABEL[$I]}_${GRAPH_TYPE}_${R1}s_${R2}s_${TIME_LENGTH}.png end-${TIME_LENGTH} \"${END_TIME}\" ${R1} ${R2}"
if [ ${SUBJECT_ID[$I]} -gt 0 ]; then if [ ${SUBJECT_ID[$I]} -gt 0 ]; then
COMMAND="$COMMAND \"${DESCRIPTION}\"" COMMAND="$COMMAND \"${DESCRIPTION}\""
else else
if [ "${DESCRIPTION_IN}x" != "x" ]; then COMMAND="$COMMAND \"${DESCRIPTION_IN}\""
COMMAND="$COMMAND \"${DESCRIPTION_IN}\""
else
COMMAND="$COMMAND \"${DESCRIPTION_OUT}\""
fi
fi fi
echo "COMMAND: $COMMAND" echo "COMMAND: $COMMAND"
......
RRD_DIR=/var/lib/rrd RRD_DIR=/var/lib/rrd
usage() { PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
if [ $# -ne 8 ]; then
echo "Usage: $0 <prefix_in> <prefix_out> <filename_graph> <start_time> <end_time> <resolution 1> <resolution 2> <title>" echo "Usage: $0 <prefix_in> <prefix_out> <filename_graph> <start_time> <end_time> <resolution 1> <resolution 2> <title>"
echo "One of <prefix_in> or <prefix_out> can be empty string \"\"" echo "<prefix_out> can be empty string \"\""
echo "Example:" echo "Example:"
echo "$0 \\" echo "$0 \\"
echo " /var/lib/rrd/perfmon-plzen.cesnet.cz-eth1-0-1 \\" echo " /var/lib/rrd/perfmon-plzen.cesnet.cz-eth1-0-1 \\"
...@@ -11,10 +13,6 @@ usage() { ...@@ -11,10 +13,6 @@ usage() {
echo " \"14:33 20060504\" \"15:00 20060504\"" echo " \"14:33 20060504\" \"15:00 20060504\""
echo " 1 60" echo " 1 60"
echo " \"CESNET - GN2\"" echo " \"CESNET - GN2\""
}
if [ $# -ne 8 ]; then
usage
exit -1 exit -1
fi fi
...@@ -27,9 +25,9 @@ R1=$6 ...@@ -27,9 +25,9 @@ R1=$6
R2=$7 R2=$7
TITLE=$8 TITLE=$8
if [ "x$PREFIX_OUT" != "x" -a "x$PREFIX_IN" != "x" ]; then if [ "x$PREFIX_OUT" != "x" ]; then
rrdtool graph ${FILENAME_GRAPH} --width 600 --height 450 \ rrdtool graph ${FILENAME_GRAPH} --width 650 --height 450 \
--start "${START_TIME}" --end "${END_TIME}" \ --start "${START_TIME}" --end "${END_TIME}" \
--slope-mode --interlaced --vertical-label "out Mb/s in" \ --slope-mode --interlaced --vertical-label "out Mb/s in" \
--title "${TITLE}: applications, interval $R1 second(s), avg/max $R2 seconds" -X 0 \ --title "${TITLE}: applications, interval $R1 second(s), avg/max $R2 seconds" -X 0 \
...@@ -87,11 +85,11 @@ rrdtool graph ${FILENAME_GRAPH} --width 600 --height 450 \ ...@@ -87,11 +85,11 @@ rrdtool graph ${FILENAME_GRAPH} --width 600 --height 450 \
LINE2:all_out_neg_max_r2#0000FF \ LINE2:all_out_neg_max_r2#0000FF \
LINE:0#000000 LINE:0#000000
elif [ "x$PREFIX_IN" != "x" ]; then else
rrdtool graph ${FILENAME_GRAPH} --width 600 --height 450 \ rrdtool graph ${FILENAME_GRAPH} --width 650 --height 225 \
--start "${START_TIME}" --end "${END_TIME}" \ --start "${START_TIME}" --end "${END_TIME}" \
--slope-mode --interlaced --vertical-label " Mb/s in" \ --slope-mode --interlaced --vertical-label " Mb/s " \
--title "${TITLE}: applications, interval $R1 second(s), avg/max $R2 seconds" -X 0 \ --title "${TITLE}: applications, interval $R1 second(s), avg/max $R2 seconds" -X 0 \
DEF:all_in=${PREFIX_IN}-all.rrd:mbps:AVERAGE:step=$R1 \ DEF:all_in=${PREFIX_IN}-all.rrd:mbps:AVERAGE:step=$R1 \
DEF:all_in_avg_r2=${PREFIX_IN}-all.rrd:mbps:AVERAGE:step=$R2 \ DEF:all_in_avg_r2=${PREFIX_IN}-all.rrd:mbps:AVERAGE:step=$R2 \
...@@ -116,50 +114,4 @@ rrdtool graph ${FILENAME_GRAPH} --width 600 --height 450 \ ...@@ -116,50 +114,4 @@ rrdtool graph ${FILENAME_GRAPH} --width 600 --height 450 \
LINE2:all_in_max_r2#0000FF:"Maximum ($R2 seconds)" \ LINE2:all_in_max_r2#0000FF:"Maximum ($R2 seconds)" \
LINE:0#000000 LINE:0#000000
elif [ "x$PREFIX_OUT" != "x" ]; then
rrdtool graph ${FILENAME_GRAPH} --width 600 --height 450 \
--start "${START_TIME}" --end "${END_TIME}" \
--slope-mode --interlaced --vertical-label "out Mb/s " \
--title "${TITLE}: applications, interval $R1 second(s), avg/max $R2 seconds" -X 0 \
DEF:all_out=${PREFIX_OUT}-all.rrd:mbps:AVERAGE:step=$R1 \
DEF:all_out_avg_r2=${PREFIX_OUT}-all.rrd:mbps:AVERAGE:step=$R2 \
DEF:all_out_max_r2=${PREFIX_OUT}-all.rrd:mbps:MAX:step=$R2 \
DEF:http_out=${PREFIX_OUT}-http.rrd:mbps:AVERAGE:step=$R1 \
DEF:https_out=${PREFIX_OUT}-https.rrd:mbps:AVERAGE:step=$R1 \
DEF:ftp_out=${PREFIX_OUT}-ftp.rrd:mbps:AVERAGE:step=$R1 \
DEF:gnutella_out=${PREFIX_OUT}-gnutella.rrd:mbps:AVERAGE:step=$R1 \
DEF:torrent_out=${PREFIX_OUT}-torrent.rrd:mbps:AVERAGE:step=$R1 \
DEF:dc_out=${PREFIX_OUT}-dc.rrd:mbps:AVERAGE:step=$R1 \
DEF:edonkey_out=${PREFIX_OUT}-edonkey.rrd:mbps:AVERAGE:step=$R1 \
CDEF:all_out_neg=all_out,-1,* \
CDEF:all_out_neg_avg_r2=all_out_avg_r2,-1,* \
CDEF:all_out_neg_max_r2=all_out_max_r2,-1,* \
CDEF:http_out_neg=http_out,-1,* \
CDEF:https_out_neg=https_out,-1,* \
CDEF:ftp_out_neg=ftp_out,-1,* \
CDEF:gnutella_out_neg=gnutella_out,-1,* \
CDEF:torrent_out_neg=torrent_out,-1,* \
CDEF:dc_out_neg=dc_out,-1,* \
CDEF:edonkey_out_neg=edonkey_out,-1,* \
AREA:all_out_neg#FFFF00 \
LINE:0 \
AREA:http_out_neg#00FF00::STACK \
AREA:https_out_neg#FF0000::STACK \
AREA:ftp_out_neg#FF00FF::STACK \
AREA:gnutella_out_neg#50FF00::STACK \
AREA:torrent_out_neg#FF5000::STACK \
AREA:dc_out_neg#FF50FF::STACK \
AREA:edonkey_out_neg#5050FF::STACK \
LINE2:all_out_neg_avg_r2#00FFFF \
LINE2:all_out_neg_max_r2#0000FF \
LINE:0#000000
else
echo "At least one of <prefix_in> or <prefix_out> must be non-empty"
echo ""
usage
exit -1
fi fi
RRD_DIR=/usr/local/abw/rrd RRD_DIR=/usr/local/abw/rrd
usage() { PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
if [ $# -ne 8 ]; then
echo "Usage: $0 <prefix_in> <prefix_out> <filename_graph> <start_time> <end_time> <resolution 1> <resolution 2> <title>" echo "Usage: $0 <prefix_in> <prefix_out> <filename_graph> <start_time> <end_time> <resolution 1> <resolution 2> <title>"
echo "One of <prefix_in> or <prefix_out> can be empty string \"\"" echo "<prefix_out> can be empty string \"\""
echo "Example:" echo "Example:"
echo "$0 \\" echo "$0 \\"
echo " /usr/local/abw/rrd/perfmon-plzen.cesnet.cz-eth1-0-1 \\" echo " /usr/local/abw/rrd/perfmon-plzen.cesnet.cz-eth1-0-1 \\"
...@@ -11,10 +13,6 @@ usage() { ...@@ -11,10 +13,6 @@ usage() {
echo " \"14:33 20060504\" \"15:00 20060504\"" echo " \"14:33 20060504\" \"15:00 20060504\""
echo " 1 60" echo " 1 60"
echo " \"CESNET - GN2\"" echo " \"CESNET - GN2\""
}
if [ $# -ne 8 ]; then
usage
exit -1 exit -1
fi fi
...@@ -27,7 +25,7 @@ R1=$6 ...@@ -27,7 +25,7 @@ R1=$6
R2=$7 R2=$7
TITLE=$8 TITLE=$8
if [ "x$PREFIX_OUT" != "x" -a "x$PREFIX_IN" != "x" ]; then if [ "x$PREFIX_OUT" != "x" ]; then
rrdtool graph ${FILENAME_GRAPH} --width 600 --height 450 \ rrdtool graph ${FILENAME_GRAPH} --width 600 --height 450 \
--start "${START_TIME}" --end "${END_TIME}" \ --start "${START_TIME}" --end "${END_TIME}" \
...