monitoring počtu překročení FUP, a pokus o HTML validaci
authorxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Tue, 29 Nov 2011 13:24:01 +0000 (13:24 +0000)
committerxchaos <xchaos@251d49ef-1d17-4917-a970-b30cf55b089b>
Tue, 29 Nov 2011 13:24:01 +0000 (13:24 +0000)
git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@153 251d49ef-1d17-4917-a970-b30cf55b089b

prometheus.c

index 5420588d352e8d6550e0c430305926ea2e33bfc2..4731bcc2dac89bdaedcc9d37421c702066f65ad9 100644 (file)
@@ -1525,7 +1525,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
 \r
    for_each(keyword,keywords)\r
    {\r
-    fprintf(f,"<td align=\"right\"><font color=\"#%s\">%d M</font></td>",keyword->html_color,group->min*keyword->data_limit);\r
+    fprintf(f,"<td align=\"right\"><span style=\"color:#%s\">%d M</span></td>",keyword->html_color,group->min*keyword->data_limit);\r
    }   \r
    i+=group->desired; \r
    total+=group->count;\r
@@ -1557,6 +1557,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
   int colspan;\r
   FILE *iplog;\r
   struct Sum {unsigned long long l; int i; list(Sum);} *sum,*sums=NULL;\r
+  int limit_count=0, prio_count=0;\r
 \r
   colspan=11;\r
   if(qos_proxy)\r
@@ -1594,13 +1595,15 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
    char *f1="", *f2="";\r
    if(ip->max<ip->desired)\r
    {\r
-    f1="<font color=\"red\">";\r
-    f2="</font>";\r
+    f1="<span style=\"color:red\">";\r
+    f2="</span>";\r
+    limit_count++;\r
    }\r
    else if(ip->prio>highest_priority+1)\r
    {\r
-    f1="<font color=\"brown\">";\r
-    f2="</font>";\r
+    f1="<span style=\"color:brown\">";\r
+    f2="</span>";\r
+    prio_count++;\r
    }\r
 \r
 #ifdef DEBUG\r
@@ -1622,7 +1625,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
     fputs("</td>\n",f);    \r
    }\r
    fprintf(f,"<td align=\"right\">%Lu M</td>\n", ip->credit);\r
-   fprintf(f,"<td align=\"right\"><font color=\"#%s\">%Lu M</font></td>",\r
+   fprintf(f,"<td align=\"right\"><span style=\"color:#%s\">%Lu M</span></td>",\r
              ip->keyword->html_color, ip->credit+(ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20)));\r
    fprintf(f,"<td align=\"right\">%s%Lu M%s</td><td align=\"right\">%Lu M</td>\n", f1, ip->traffic, f2, ip->direct);\r
    if(qos_proxy)\r
@@ -1668,7 +1671,7 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
    fprintf(f,"<th align=\"right\">%Lu M</th>\n", total_proxy);\r
   }\r
   fprintf(f,"<th align=\"right\">%Lu M</th>", total_upload);\r
-  fputs("<td colspan=\"4\"></td></th>\n</table>\n",f);\r
+  fprintf(f,"<th colspan=\"4\"><span style=\"color:red\">FUP-LIMIT %dx</span> <span style=\"color:brown\">LOW-PRIO %dx</span></th></tr>\n</table>\n",limit_count,prio_count);\r
 \r
   if(active_classes>10)\r
   {\r
@@ -1743,8 +1746,9 @@ Credit: CZFree.Net, Martin Devera, Netdave, Aquarius, Gandalf\n\n",version);
     iplog=fopen(str,"a");\r
     if(iplog)\r
     {\r
-     fprintf(iplog,"%ld\t%d\t%d %%\t%Lu M\t%Ld %%\t%d\t%Lu M\t%d\t%s",\r
-                    time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, active_classes, total_traffic, total, d); /* d = date*/\r
+     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",\r
+                    time(NULL), top20_count, top20_perc1, top20_sum, top20_perc2, \r
+                    active_classes, total_traffic, total, limit_count, prio_count, d); /* d = date*/\r
      fclose(iplog);\r
     }\r
    }\r
This page took 0.12274 seconds and 4 git commands to generate.