From 78884bad50568440ce643e5155b60fda9aa30262 Mon Sep 17 00:00:00 2001 From: xchaos Date: Tue, 29 Nov 2011 13:24:01 +0000 Subject: [PATCH] =?utf8?q?monitoring=20po=C4=8Dtu=20p=C5=99ekro=C4=8Den?= =?utf8?q?=C3=AD=20FUP,=20a=20pokus=20o=20HTML=20validaci?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@153 251d49ef-1d17-4917-a970-b30cf55b089b --- prometheus.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/prometheus.c b/prometheus.c index 5420588..4731bcc 100644 --- a/prometheus.c +++ b/prometheus.c @@ -1525,7 +1525,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); for_each(keyword,keywords) { - fprintf(f,"%d M",keyword->html_color,group->min*keyword->data_limit); + fprintf(f,"%d M",keyword->html_color,group->min*keyword->data_limit); } i+=group->desired; total+=group->count; @@ -1557,6 +1557,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); int colspan; FILE *iplog; struct Sum {unsigned long long l; int i; list(Sum);} *sum,*sums=NULL; + int limit_count=0, prio_count=0; colspan=11; if(qos_proxy) @@ -1594,13 +1595,15 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); char *f1="", *f2=""; if(ip->maxdesired) { - f1=""; - f2=""; + f1=""; + f2=""; + limit_count++; } else if(ip->prio>highest_priority+1) { - f1=""; - f2=""; + f1=""; + f2=""; + prio_count++; } #ifdef DEBUG @@ -1622,7 +1625,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); fputs("\n",f); } fprintf(f,"%Lu M\n", ip->credit); - fprintf(f,"%Lu M", + fprintf(f,"%Lu M", ip->keyword->html_color, ip->credit+(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20))); fprintf(f,"%s%Lu M%s%Lu M\n", f1, ip->traffic, f2, ip->direct); if(qos_proxy) @@ -1668,7 +1671,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); fprintf(f,"%Lu M\n", total_proxy); } fprintf(f,"%Lu M", total_upload); - fputs("\n\n",f); + fprintf(f,"FUP-LIMIT %dx LOW-PRIO %dx\n\n",limit_count,prio_count); if(active_classes>10) { @@ -1743,8 +1746,9 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version); iplog=fopen(str,"a"); if(iplog) { - fprintf(iplog,"%ld\t%d\t%d %%\t%Lu M\t%Ld %%\t%d\t%Lu M\t%d\t%s", - time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, active_classes, total_traffic, total, d); /* d = date*/ + fprintf(iplog,"%ld\t%d\t%d %%\t%Lu M\t%Ld %%\tACTIVE %d\tTRAFFIC %Lu M\tCLASSES %d\tFUP-LIMIT %d\tLOW-PRIO %d\t%s", + time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, + active_classes, total_traffic, total, limit_count, prio_count, d); /* d = date*/ fclose(iplog); } } -- 2.30.2