mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
add touched addresses counts to xml and json reports
For some reason missing information has been overlooked for years. Perhaps there is aren't that many users who are interested of the touched addresses. Proposed-by: Aaron Paetznick <aaronp@critd.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
73b357484d
commit
0d6c61d437
3 changed files with 9 additions and 1 deletions
1
THANKS
1
THANKS
|
|
@ -32,3 +32,4 @@ Dan Pritts
|
|||
Fredrik Lysén
|
||||
Conor McCarthy
|
||||
Wolfgang Steudel
|
||||
Aaron Paetznick
|
||||
|
|
|
|||
|
|
@ -268,6 +268,7 @@ int output_xml(void)
|
|||
fprintf(outfile, "- %s</range>\n", ntop_ipaddr(&range_p->last_ip));
|
||||
fprintf(outfile, "\t<defined>%g</defined>\n", range_size);
|
||||
fprintf(outfile, "\t<used>%g</used>\n", range_p->count);
|
||||
fprintf(outfile, "\t<touched>%g</touched>\n", range_p->touched);
|
||||
fprintf(outfile, "\t<free>%g</free>\n", range_size - range_p->count);
|
||||
range_p++;
|
||||
range_size = get_range_size(range_p);
|
||||
|
|
@ -282,6 +283,7 @@ int output_xml(void)
|
|||
fprintf(outfile, "\t<location>%s</location>\n", shared_p->name);
|
||||
fprintf(outfile, "\t<defined>%g</defined>\n", shared_p->available);
|
||||
fprintf(outfile, "\t<used>%g</used>\n", shared_p->used);
|
||||
fprintf(outfile, "\t<touched>%g</touched>\n", shared_p->touched);
|
||||
fprintf(outfile, "\t<free>%g</free>\n",
|
||||
shared_p->available - shared_p->used);
|
||||
fprintf(outfile, "</shared-network>\n");
|
||||
|
|
@ -293,6 +295,7 @@ int output_xml(void)
|
|||
fprintf(outfile, "\t<location>%s</location>\n", shared_networks->name);
|
||||
fprintf(outfile, "\t<defined>%g</defined>\n", shared_networks->available);
|
||||
fprintf(outfile, "\t<used>%g</used>\n", shared_networks->used);
|
||||
fprintf(outfile, "\t<touched>%g</touched>\n", shared_networks->touched);
|
||||
fprintf(outfile, "\t<free>%g</free>\n",
|
||||
shared_networks->available - shared_networks->used);
|
||||
fprintf(outfile, "</summary>\n");
|
||||
|
|
@ -385,6 +388,7 @@ int output_json(void)
|
|||
fprintf(outfile, " - %s\", ", ntop_ipaddr(&range_p->last_ip));
|
||||
fprintf(outfile, "\"defined\":%g, ", range_size);
|
||||
fprintf(outfile, "\"used\":%g, ", range_p->count);
|
||||
fprintf(outfile, "\"touched\":%g, ", range_p->touched);
|
||||
fprintf(outfile, "\"free\":%g ", range_size - range_p->count);
|
||||
range_p++;
|
||||
range_size = get_range_size(range_p);
|
||||
|
|
@ -409,6 +413,7 @@ int output_json(void)
|
|||
fprintf(outfile, "\"location\":\"%s\", ", shared_p->name);
|
||||
fprintf(outfile, "\"defined\":%g, ", shared_p->available);
|
||||
fprintf(outfile, "\"used\":%g, ", shared_p->used);
|
||||
fprintf(outfile, "\"touched\":%g, ", shared_p->touched);
|
||||
fprintf(outfile, "\"free\":%g ", shared_p->available - shared_p->used);
|
||||
if (i + 1 < num_shared_networks)
|
||||
fprintf(outfile, "},\n");
|
||||
|
|
@ -427,6 +432,7 @@ int output_json(void)
|
|||
fprintf(outfile, " \"location\":\"%s\",\n", shared_networks->name);
|
||||
fprintf(outfile, " \"defined\":%g,\n", shared_networks->available);
|
||||
fprintf(outfile, " \"used\":%g,\n", shared_networks->used);
|
||||
fprintf(outfile, " \"touched\":%g,\n", shared_networks->touched);
|
||||
fprintf(outfile, " \"free\":%g\n",
|
||||
shared_networks->available - shared_networks->used);
|
||||
fprintf(outfile, " }"); /* end of summary */
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
{ "ip":"10.0.0.5", "macaddress":"00:00:00:00:00:00" }
|
||||
],
|
||||
"subnets": [
|
||||
{ "location":"All networks", "range":"10.0.0.1 - 10.0.0.10", "defined":10, "used":1, "free":9 }
|
||||
{ "location":"All networks", "range":"10.0.0.1 - 10.0.0.10", "defined":10, "used":1, "touched":0, "free":9 }
|
||||
],
|
||||
"shared-networks": [
|
||||
],
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
"location":"All networks",
|
||||
"defined":10,
|
||||
"used":1,
|
||||
"touched":0,
|
||||
"free":9
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue