mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 00:06:59 +00:00
output: add some trivia data to json output
These are software version, dhcpd conf and leases paths and mtime epoch timestamps. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
444815f964
commit
46ec42182b
3 changed files with 18 additions and 3 deletions
14
src/output.c
14
src/output.c
|
|
@ -596,7 +596,19 @@ static int output_json(struct conf_t *state, const int print_mac_addreses)
|
|||
fprintf(outfile, " \"backup_percent\":%g,\n", oh.bup);
|
||||
}
|
||||
fprintf(outfile, " \"status\":%d\n", oh.status);
|
||||
fprintf(outfile, " }"); /* end of summary */
|
||||
fprintf(outfile, " },\n"); /* end of summary */
|
||||
fprintf(outfile, " \"trivia\": {\n");
|
||||
fprintf(outfile, " \"version\":\"%s\",\n", PACKAGE_VERSION);
|
||||
fprintf(outfile, " \"conf_file_path\":\"%s\",\n", state->dhcpdconf_file);
|
||||
fprintf(outfile, " \"conf_file_epoch_mtime\":");
|
||||
dp_time_tool(outfile, state->dhcpdconf_file, 1);
|
||||
fprintf(outfile, ",\n");
|
||||
fprintf(outfile, " \"lease_file_path\":\"%s\",\n", state->dhcpdlease_file);
|
||||
fprintf(outfile, " \"lease_file_epoch_mtime\":");
|
||||
dp_time_tool(outfile, state->dhcpdlease_file, 1);
|
||||
fprintf(outfile, "\n");
|
||||
|
||||
fprintf(outfile, " }"); /* end of trivia */
|
||||
}
|
||||
fprintf(outfile, "\n}\n");
|
||||
close_outfile(outfile);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue