From 1eb533f94b31be358be3df053a12aeb2e4ba9fbd Mon Sep 17 00:00:00 2001 From: Babak Farrokhi Date: Sat, 12 Sep 2015 19:02:13 +0430 Subject: [PATCH] - Improve config() --- ifstatd.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ifstatd.c b/ifstatd.c index 002fd2b..13fbdac 100644 --- a/ifstatd.c +++ b/ifstatd.c @@ -109,12 +109,24 @@ fill_iftot(struct iftot *st) int config(char *iface) { printf( - "graph_title HighRes Interface Traffic Stat\n" + "graph_order rbytes obytes" + "graph_title %s Interface (HighRes)\n" "graph_category network::10sec\n" - "graph_vlabel Traffic\n" + "graph_vlabel bits per second\n" "update_rate 10\n" "graph_data_size custom 1d, 10s for 1w, 1m for 1t, 5m for 1y\n" - "" + "rbytes.label received" + "rbytes.type DERIVE" + "rbytes.graph no" + "rbytes.cdef rbytes,8,*" + "rbytes.min 0" + "obytes.label bps" + "obytes.type DERIVE" + "obytes.negative rbytes" + "obytes.cdef obytes,8,*" + "obytes.min 0" + "obytes.draw AREA" + ,iface ); return(0); @@ -161,7 +173,7 @@ main(int argc, char* argv[]) if (argc > 1) { char* first_arg = argv[1]; if (! strcmp(first_arg, "config")) { - return config(); + return config(interface); } if (! strcmp(first_arg, "acquire")) {