Commit e4eeed93 authored by 's avatar
Browse files

git-svn-id: file:///home/svn/mapi/trunk@617 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent cb482130
......@@ -8,6 +8,7 @@ INSTALL=/usr/bin/install -c
LIB_DIRS=
RLIB_DIRS=
INCLUDE_DIRS=
INSTALL_DIR=/usr/local/abw
TARGETS=abw abw_dummy test_abw_time test_config
# OBJS=abw.o abw_common.o abw_mysql.o abw_time.o abw_dummy.o test_abw_time.o test_config.o abw_conf.o
......@@ -38,9 +39,17 @@ clean:
rm -f *.out core
install: all
mkdir -p /var/lib/rrd
cp abw /usr/local/bin
cp abw_restart.sh /usr/local/bin
cp rrd_create.sh /usr/local/bin
cp -u abw.cfg /etc
cp -u abw_const.cfg /etc
mkdir -p $(INSTALL_DIR)
mkdir -p $(INSTALL_DIR)/bin
mkdir -p $(INSTALL_DIR)/etc
mkdir -p $(INSTALL_DIR)/graph
mkdir -p $(INSTALL_DIR)/rrd
cp abw $(INSTALL_DIR)/bin
cp rrd_create.sh $(INSTALL_DIR)/bin
cp rrd_graph_l4.sh $(INSTALL_DIR)/bin
cp rrd_graph_apps.sh $(INSTALL_DIR)/bin
cp rrd_graph_all.sh $(INSTALL_DIR)/bin
cp -u abw.cfg $(INSTALL_DIR)/etc
cp -u abw_const.cfg $(INSTALL_DIR)/etc
cp mapi.sh /usr/local/bin
cp abw.sh /usr/local/bin
......@@ -178,6 +178,14 @@ does measurements (it runs continuously). But these strings are used
when abw retrieve results.
Bandwidth usage:
abw connected to 3 remote stations monitoring 5 interfaces
produced 8392 packets and 907 kB captured by tcpdump in 1 minute.
Top after about 8 hours when abw stopped:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
14958 root 21 0 171m 2312 1024 S 80.0 0.2 442:26.47 abw
16091 root 17 0 419m 3348 768 S 20.0 0.3 548:41.08 mapid
......@@ -3,9 +3,10 @@
#include <string.h>
#include <unistd.h>
#define __USE_XOPEN
#include <time.h>
#include <sys/time.h>
#include <time.h>
#include <math.h>
#include <syslog.h>
#include <mysql/mysql.h>
......@@ -48,6 +49,10 @@ int main(int argc, char *argv[])
double seconds; /* interval between measurements */
char command[MAX_COMMAND+1];
char hostname_interface[256]; /* DiMAPI subject as "hostname:interface" */
struct timeval tv_start, tv_stop; /* to measure how fast mapi_read_result()
responds */
openlog("abw", LOG_PID, LOG_LOCAL0);
/* Create first flow specification, subject and parameters so that they
can be filled-in by command-line options */
......@@ -412,19 +417,21 @@ int main(int argc, char *argv[])
if (!global_spec.no_stdout && !global_spec.stdout_simple)
printf(" %s:", q->protocol);
gettimeofday(&tv_start, NULL);
if ((q->pkt_counter_res=(struct dmapi_results*)
mapi_read_results(q->fd, q->pkt_counter_fid))==NULL) {
fprintf(stderr, "%s: mapi_read_results() for flow %d failed\n",
__func__, i);
return -1;
}
if ((q->byte_counter_res=(struct dmapi_results*)
mapi_read_results(q->fd, q->byte_counter_fid))==NULL) {
fprintf(stderr, "%s: mapi_read_results() for flow %d failed\n",
__func__, i);
return -1;
}
gettimeofday(&tv_stop, NULL);
q->pkt_counter=*((unsigned long long*)q->pkt_counter_res->res[0].result);
......@@ -438,28 +445,47 @@ int main(int argc, char *argv[])
we add 4 bytes for CRC and 20 bytes for inter-frame gap,
preamble and start-of-frame delimitter for each packet */
if (q->tv_stop_old.tv_sec)
seconds=timestamp_diff(&(q->tv_stop_old), &tv_stop)/1000000.0;
else
seconds=p->parameters->interval.tv_sec +
p->parameters->interval.tv_usec * 0.000001;
q->tv_stop_old.tv_sec = tv_stop.tv_sec;
q->tv_stop_old.tv_usec = tv_stop.tv_usec;
mbps=bytes*8/1000000;
mbps2=(bytes+packets*24)*8/1000000;
seconds=p->parameters->interval.tv_sec +
p->parameters->interval.tv_usec * 0.000001;
if (!global_spec.no_stdout) {
if (global_spec.stdout_simple)
printf(" %0.2f %0.2f %0.2f", packets/seconds,
bytes/seconds, mbps2/seconds);
else
printf(" %0.2f packets/s %0.2f bytes/s %0.2f Mb/s\n",
packets/seconds, bytes/seconds, mbps2/seconds);
printf(" %0.2f packets/s, %0.2f bytes/s, %0.2f Mb/s, time %uus, interval %0.2f\n",
packets/seconds, bytes/seconds, mbps2/seconds,
timestamp_diff(&tv_start, &tv_stop), seconds);
/* if (timestamp_diff(&tv_start, &tv_stop)>1000000)
return 0; */
/* q->pkt_counter_res->res[0].t_received -
q->pkt_counter_res->res[0].t_produced,
q->byte_counter_res->res[0].t_received -
q->byte_counter_res->res[0].t_produced); */
}
/* If interval is at least 1 second, then store results
to RRD file */
if (p->parameters->interval.tv_sec) {
sprintf(command, "rrdtool update %s %u:%llu:%llu:%u",
sprintf(command, "rrdtool update %s %u:%lu:%lu:%lu",
q->rrd_filename, (unsigned int)(tm.tv_sec),
packets, bytes, (unsigned int)round(mbps2));
(unsigned long)(packets/seconds),
(unsigned long)(bytes/seconds),
(unsigned long)(mbps2/seconds));
syslog(LOG_DEBUG, "system(%s)", command);
if (debug)
printf("%s: system(%s)\n", __func__, command);
......@@ -514,15 +540,17 @@ int main(int argc, char *argv[])
} /* while (i<MAX_FLOWS && *pp) */
if (!global_spec.no_stdout && !global_spec.stdout_simple)
printf("\n");
/* TODO: wait until next checkpoint (not a fixed delay) of
the flow whose checkpoint is earliest */
abw_next_timestamp(&(global_spec.flow_spec[0]->parameters->interval),
&next, &wait);
/* printf("next.tv_sec: %d, next.tv_usec: %d, wait.tv_sec: %d, wait.tv_usec: %d\n", (int)(next.tv_sec), (int)(next.tv_usec), (int)(wait.tv_sec), (int)(wait.tv_usec)); */
if (!global_spec.no_stdout && !global_spec.stdout_simple)
printf("next.tv_sec: %d, next.tv_usec: %d, wait.tv_sec: %d, wait.tv_usec: %d\n", (int)(next.tv_sec), (int)(next.tv_usec), (int)(wait.tv_sec), (int)(wait.tv_usec));
if (!global_spec.no_stdout && !global_spec.stdout_simple)
printf("===============================================================================\n");
usleep(wait.tv_sec * 1000000 + wait.tv_usec);
......
......@@ -51,6 +51,7 @@ typedef struct {
unsigned long long old_pkt_counter; /* previous number of packets from PKT_COUNTER */
unsigned long long old_byte_counter; /* previous number of bytes from BYTE_COUNTER */
char *rrd_filename;
struct timeval tv_stop_old; /* time after last mapi_read_result() */
} flow_run_t;
typedef struct {
......@@ -161,4 +162,6 @@ int protocol_filter(char *header_filter, char *protocol, int mpls,
int get_local_hostname(char **hostname);
int timestamp_diff(struct timeval *tv_start, struct timeval *tv_stop);
#endif
......@@ -325,3 +325,41 @@ int get_local_hostname(char **hostname) {
return 0;
} /* get_local_hostname() */
int timestamp_diff(struct timeval *tv_start, struct timeval *tv_stop) {
int sec, usec;
if (tv_start==NULL || tv_stop==NULL) {
fprintf(stderr, "%s: tv_start or tv_stop is NULL\n", __func__);
return -1;
}
usec=0;
/* printf("tv_start->tv_sec: %u, tv_start->tv_usec: %u\n",
(unsigned int)(tv_start->tv_sec), (unsigned int)(tv_start->tv_usec));
printf("tv_stop->tv_sec: %u, tv_stop->tv_usec: %u\n",
(unsigned int)(tv_stop->tv_sec), (unsigned int)(tv_stop->tv_usec)); */
sec=tv_stop->tv_sec - tv_start->tv_sec;
if (sec<0) {
fprintf(stderr, "%s: stop is less than start\n", __func__);
return -1;
}
if (sec>1)
usec = (tv_stop->tv_sec - tv_start->tv_sec - 1)*1000000;
if (sec)
usec += 1000000-tv_start->tv_usec + tv_stop->tv_usec;
else
usec = tv_stop->tv_usec - tv_start->tv_usec;
if (usec<0) {
fprintf(stderr, "%s: stop is less than start\n", __func__);
return -1;
}
return usec;
} /* timestamp_diff() */
......@@ -6,7 +6,7 @@
#include "abw.h"
#define ABW_CONST_CFG "/etc/abw_const.cfg"
#define ABW_CONST_CFG "/usr/local/abw/etc/abw_const.cfg"
/*
* Leading colon ":" makes getopt() to return colon ":" rather than
......
......@@ -4,8 +4,8 @@
#include "abw.h"
#define MAX_RRD_FILENAME 256
#define RRD_CREATE_SCRIPT "/usr/local/bin/rrd_create.sh"
#define RRD_DIRECTORY "/var/lib/rrd/" /* include trailing / */
#define RRD_CREATE_SCRIPT "/usr/local/abw/bin/rrd_create.sh"
#define RRD_DIRECTORY "/usr/local/abw/rrd/" /* include trailing / */
char *abw_rrd_create_filename(char *hostname, char *interface,
int port, int parameters_id, char *protocol);
......
......@@ -37,6 +37,8 @@ int abw_next_timestamp(struct timeval *interval,
last.tv_sec < current.tv_sec ||
(last.tv_sec == current.tv_sec && last.tv_usec < current.tv_usec)) {
printf("%s: Next interval missed, will wait until nearest future interval\n", __func__);
if (interval->tv_sec)
last.tv_sec=(current.tv_sec / interval->tv_sec * interval->tv_sec)
+ interval->tv_sec;
......
......@@ -14,17 +14,18 @@ rrdtool create $1 --start 0 --step 1 \
DS:packets:GAUGE:5:U:U \
DS:bytes:GAUGE:5:U:U \
DS:mbps:GAUGE:5:U:U \
RRA:AVERAGE:0.5:1:10800 \
RRA:LAST:0:1:10800 \
RRA:AVERAGE:0:1:10800 \
RRA:AVERAGE:0.5:10:8640 \
RRA:AVERAGE:0.5:60:20160 \
RRA:AVERAGE:0.5:300:4032 \
RRA:AVERAGE:0.5:600:4032 \
RRA:AVERAGE:0.5:3600:18288 \
RRA:MIN:0.5:10:8640 \
RRA:MIN:0.5:60:20160 \
RRA:MIN:0.5:300:4032 \
RRA:MIN:0.5:600:4032 \
RRA:MIN:0.5:3600:18288 \
RRA:MAX:0.5:10:8640 \
RRA:MAX:0.5:60:20160 \
RRA:MAX:0.5:300:4032 \
RRA:MAX:0.5:600:4032 \
RRA:MAX:0.5:3600:18288
RRD_DIR=/var/lib/rrd
if [ $# -ne 5 ]; then
echo "Usage: $0 <prefix_in> <prefix_out> <filename_graph> <start_time> <end_time>"
if [ $# -ne 8 ]; then
echo "Usage: $0 <prefix_in> <prefix_out> <filename_graph> <start_time> <end_time> <resolution 1> <resolution 2> <title>"
echo "Example:"
echo "$0 \\"
echo " /var/lib/rrd/perfmon-plzen.cesnet.cz-eth1-0-1 \\"
echo " /var/lib/rrd/perfmon-plzen.cesnet.cz-eth2-0-1 \\"
echo " perfmon-plzen_apps.png \\"
echo " \"14:33 20060504\" \"15:00 20060504\""
echo " 1 60"
echo " \"CESNET - GN2\""
exit -1
fi
......@@ -10,34 +18,37 @@ PREFIX_OUT=$2
FILENAME_GRAPH=$3
START_TIME=$4
END_TIME=$5
R1=$6
R2=$7
TITLE=$8
rrdtool graph ${FILENAME_GRAPH} --width 650 --height 450 \
--start "${START_TIME}" --end "${END_TIME}" \
--slope-mode --interlaced --vertical-label "out Mb/s in" \
--title "Aplikacni protokoly, interval 1 sekunda" -X 0 \
DEF:all_in=${PREFIX_IN}-all.rrd:mbps:AVERAGE:step=1 \
DEF:all_in_avg60=${PREFIX_IN}-all.rrd:mbps:AVERAGE:step=60 \
DEF:all_in_max60=${PREFIX_IN}-all.rrd:mbps:MAX:step=60 \
DEF:http_in=${PREFIX_IN}-http.rrd:mbps:AVERAGE:step=1 \
DEF:https_in=${PREFIX_IN}-https.rrd:mbps:AVERAGE:step=1 \
DEF:ftp_in=${PREFIX_IN}-ftp.rrd:mbps:AVERAGE:step=1 \
DEF:gnutella_in=${PREFIX_IN}-gnutella.rrd:mbps:AVERAGE:step=1 \
DEF:torrent_in=${PREFIX_IN}-torrent.rrd:mbps:AVERAGE:step=1 \
DEF:dc_in=${PREFIX_IN}-dc.rrd:mbps:AVERAGE:step=1 \
DEF:edonkey_in=${PREFIX_IN}-edonkey.rrd:mbps:AVERAGE:step=1 \
DEF:all_out=${PREFIX_OUT}-all.rrd:mbps:AVERAGE:step=1 \
DEF:all_out_avg60=${PREFIX_OUT}-all.rrd:mbps:AVERAGE:step=60 \
DEF:all_out_max60=${PREFIX_OUT}-all.rrd:mbps:MAX:step=60 \
DEF:http_out=${PREFIX_OUT}-http.rrd:mbps:AVERAGE:step=1 \
DEF:https_out=${PREFIX_OUT}-https.rrd:mbps:AVERAGE:step=1 \
DEF:ftp_out=${PREFIX_OUT}-ftp.rrd:mbps:AVERAGE:step=1 \
DEF:gnutella_out=${PREFIX_OUT}-gnutella.rrd:mbps:AVERAGE:step=1 \
DEF:torrent_out=${PREFIX_OUT}-torrent.rrd:mbps:AVERAGE:step=1 \
DEF:dc_out=${PREFIX_OUT}-dc.rrd:mbps:AVERAGE:step=1 \
DEF:edonkey_out=${PREFIX_OUT}-edonkey.rrd:mbps:AVERAGE:step=1 \
--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_avg_r2=${PREFIX_IN}-all.rrd:mbps:AVERAGE:step=$R2 \
DEF:all_in_max_r2=${PREFIX_IN}-all.rrd:mbps:MAX:step=$R2 \
DEF:http_in=${PREFIX_IN}-http.rrd:mbps:AVERAGE:step=$R1 \
DEF:https_in=${PREFIX_IN}-https.rrd:mbps:AVERAGE:step=$R1 \
DEF:ftp_in=${PREFIX_IN}-ftp.rrd:mbps:AVERAGE:step=$R1 \
DEF:gnutella_in=${PREFIX_IN}-gnutella.rrd:mbps:AVERAGE:step=$R1 \
DEF:torrent_in=${PREFIX_IN}-torrent.rrd:mbps:AVERAGE:step=$R1 \
DEF:dc_in=${PREFIX_IN}-dc.rrd:mbps:AVERAGE:step=$R1 \
DEF:edonkey_in=${PREFIX_IN}-edonkey.rrd:mbps:AVERAGE:step=$R1 \
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_avg60=all_out_avg60,-1,* \
CDEF:all_out_neg_max60=all_out_max60,-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,* \
......@@ -45,7 +56,7 @@ rrdtool graph ${FILENAME_GRAPH} --width 650 --height 450 \
CDEF:torrent_out_neg=torrent_out,-1,* \
CDEF:dc_out_neg=dc_out,-1,* \
CDEF:edonkey_out_neg=edonkey_out,-1,* \
AREA:all_in#FFFF00:"Ostatni" \
AREA:all_in#FFFF00:"Other" \
LINE:0 \
AREA:http_in#00FF00:"HTTP":STACK \
AREA:https_in#FF0000:"HTTPS":STACK \
......@@ -63,8 +74,8 @@ rrdtool graph ${FILENAME_GRAPH} --width 650 --height 450 \
AREA:torrent_out_neg#FF5000::STACK \
AREA:dc_out_neg#FF50FF::STACK \
AREA:edonkey_out_neg#5050FF::STACK \
LINE2:all_in_avg60#00FFFF:"Prumer (60 sekund)" \
LINE2:all_out_neg_avg60#00FFFF \
LINE2:all_in_max60#0000FF:"Maximum (60 sekund)" \
LINE2:all_out_neg_max60#0000FF \
LINE2:all_in_avg_r2#00FFFF:"Average ($R2 seconds)" \
LINE2:all_out_neg_avg_r2#00FFFF \
LINE2:all_in_max_r2#0000FF:"Maximum ($R2 seconds)" \
LINE2:all_out_neg_max_r2#0000FF \
LINE:0#000000
RRD_DIR=/var/lib/rrd
RRD_DIR=/usr/local/abw/rrd
if [ $# -ne 5 ]; then
echo "Usage: $0 <prefix_in> <prefix_out> <filename_graph> <start_time> <end_time>"
if [ $# -ne 8 ]; then
echo "Usage: $0 <prefix_in> <prefix_out> <filename_graph> <start_time> <end_time> <resolution 1> <resolution 2> <title>"
echo "Example:"
echo "$0 \\"
echo " /usr/local/abw/rrd/perfmon-plzen.cesnet.cz-eth1-0-1 \\"
echo " /usr/local/abw/rrd/perfmon-plzen.cesnet.cz-eth2-0-1 \\"
echo " graph-Plzen_PoP-l4.png \\"
echo " \"14:33 20060504\" \"15:00 20060504\""
echo " 1 60"
echo " \"CESNET - GN2\""
exit -1
fi
......@@ -10,44 +18,52 @@ PREFIX_OUT=$2
FILENAME_GRAPH=$3
START_TIME=$4
END_TIME=$5
R1=$6
R2=$7
TITLE=$8
rrdtool graph ${FILENAME_GRAPH} --width 700 --height 500 \
--start "${START_TIME}" --end "${END_TIME}" \
--slope-mode --interlaced --vertical-label "out Mb/s in" \
--title "L4 protokoly, interval 1 sekunda" -X 0 \
DEF:all_in=${PREFIX_IN}-all.rrd:mbps:AVERAGE:step=1 \
DEF:all_in_avg60=${PREFIX_IN}-all.rrd:mbps:AVERAGE:step=60 \
DEF:all_in_max60=${PREFIX_IN}-all.rrd:mbps:MAX:step=60 \
DEF:tcp_in=${PREFIX_IN}-tcp.rrd:mbps:AVERAGE:step=1 \
DEF:udp_in=${PREFIX_IN}-udp.rrd:mbps:AVERAGE:step=1 \
DEF:multicast_in=${PREFIX_IN}-multicast.rrd:mbps:AVERAGE:step=1 \
DEF:all_out=${PREFIX_OUT}-all.rrd:mbps:AVERAGE:step=1 \
DEF:all_out_avg60=${PREFIX_OUT}-all.rrd:mbps:AVERAGE:step=60 \
DEF:all_out_max60=${PREFIX_OUT}-all.rrd:mbps:MAX:step=60 \
DEF:tcp_out=${PREFIX_OUT}-tcp.rrd:mbps:AVERAGE:step=1 \
DEF:udp_out=${PREFIX_OUT}-udp.rrd:mbps:AVERAGE:step=1 \
DEF:multicast_out=${PREFIX_OUT}-multicast.rrd:mbps:AVERAGE:step=1 \
--title "${TITLE}: L4 protocols, interval $R1 second(s), avg/max $R2 seconds" -X 0 \
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_max_r2=${PREFIX_IN}-all.rrd:mbps:MAX:step=$R2 \
DEF:tcp_in=${PREFIX_IN}-tcp.rrd:mbps:AVERAGE:step=$R1 \
DEF:udp_in=${PREFIX_IN}-udp.rrd:mbps:AVERAGE:step=$R1 \
DEF:multicast_in=${PREFIX_IN}-multicast.rrd:mbps:AVERAGE:step=$R1 \
DEF:ip6_in=${PREFIX_IN}-ip6.rrd:mbps:AVERAGE:step=$R1 \
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:tcp_out=${PREFIX_OUT}-tcp.rrd:mbps:AVERAGE:step=$R1 \
DEF:udp_out=${PREFIX_OUT}-udp.rrd:mbps:AVERAGE:step=$R1 \
DEF:multicast_out=${PREFIX_OUT}-multicast.rrd:mbps:AVERAGE:step=$R1 \
DEF:ip6_out=${PREFIX_OUT}-ip6.rrd:mbps:AVERAGE:step=$R1 \
CDEF:other_in=all_in,tcp_in,-,udp_in,- \
CDEF:other_out=all_out,tcp_out,-,udp_out,- \
CDEF:all_out_neg=all_out,-1,* \
CDEF:all_out_neg_avg60=all_out_avg60,-1,* \
CDEF:all_out_neg_max60=all_out_max60,-1,* \
CDEF:all_out_neg_avg_r2=all_out_avg_r2,-1,* \
CDEF:all_out_neg_max_r2=all_out_max_r2,-1,* \
CDEF:tcp_out_neg=tcp_out,-1,* \
CDEF:udp_out_neg=udp_out,-1,* \
CDEF:multicast_out_neg=multicast_out,-1,* \
CDEF:ip6_out_neg=ip6_out,-1,* \
CDEF:other_out_neg=other_out,-1,* \
AREA:all_in#FFFF00:"Ostatni" \
AREA:all_in#FF0000:"Other" \
LINE:0 \
AREA:udp_in#00FF00:"UDP":STACK \
AREA:tcp_in#FF0000D0:"TCP":STACK \
AREA:all_out_neg#FFFF00 \
AREA:udp_in#FFFF00:"UDP":STACK \
AREA:tcp_in#00FF00:"TCP":STACK \
AREA:all_out_neg#FF0000 \
LINE:0 \
AREA:udp_out_neg#00FF00::STACK \
AREA:tcp_out_neg#FF0000D0::STACK \
LINE2:all_in_avg60#00FFFF:"Prumer (60 sekund)" \
LINE2:all_out_neg_avg60#00FFFF \
LINE2:all_in_max60#0000FF:"Maximum (60 sekund)" \
LINE2:all_out_neg_max60#0000FF \
AREA:udp_out_neg#FFFF00::STACK \
AREA:tcp_out_neg#00FF00::STACK \
LINE2:all_in_avg_r2#00FFFF:"$R2 second average" \
LINE2:all_out_neg_avg_r2#00FFFF \
LINE2:all_in_max_r2#0000FF:"$R2 second maximum" \
LINE2:all_out_neg_max_r2#0000FF \
LINE2:multicast_in#FF00FF:"Multicast" \
LINE2:multicast_out_neg#FF00FF \
LINE2:ip6_in#000000D0:"IPv6" \
LINE2:ip6_out_neg#000000D0 \
LINE:0#000000
# Use:
#
# rrd_graph_simple.sh <RRD file> <start timestamp> <end timestamp>
# rrd_graph_simple.sh <RRD file> <start time> <end time>
#
# <start time> and <end time> can be UNIX timestamp or AT_STYLE time specification,
# works for instance for -10m or now, does not work for "11:30 20060503"
if [ $# -ne 3 ]; then
echo "Usage: $0 <RRD file> <start time> <end time>"
exit -1
fi
echo "RRD file: $1"
echo "start time: $2"
echo "end time: $3"
rrdtool graph out.png -s $2 -e $3 -h 400 \
DEF:linea=$1:packets:AVERAGE LINE3:linea#FF0000:"Packets" \
......
Supports Markdown
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