X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=src%2Frrd2json.c;h=4d853930cc35a791f74b00d57046df3371574377;hb=9dccc16d3763392f0b13349de18c3a838a667653;hp=74ae1bb744df6f582600e361ed96a3cb18da6ddd;hpb=6b0797785db2e649ef1e6fc4bdeabc9ff80c0bdf;p=netdata.git diff --git a/src/rrd2json.c b/src/rrd2json.c index 74ae1bb7..4d853930 100644 --- a/src/rrd2json.c +++ b/src/rrd2json.c @@ -78,25 +78,30 @@ void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb) { rrd_stats_api_v1_chart_with_data(st, wb, NULL, NULL); } -void rrd_stats_api_v1_charts(RRDHOST *host, BUFFER *wb) -{ +void rrd_stats_api_v1_charts(RRDHOST *host, BUFFER *wb) { + static char *custom_dashboard_info_js_filename = NULL; size_t c, dimensions = 0, memory = 0, alarms = 0; RRDSET *st; time_t now = now_realtime_sec(); + if(unlikely(!custom_dashboard_info_js_filename)) + custom_dashboard_info_js_filename = config_get(CONFIG_SECTION_WEB, "custom dashboard_info.js", ""); + buffer_sprintf(wb, "{\n" "\t\"hostname\": \"%s\"" ",\n\t\"version\": \"%s\"" ",\n\t\"os\": \"%s\"" ",\n\t\"update_every\": %d" - ",\n\t\"history\": %d" + ",\n\t\"history\": %ld" + ",\n\t\"custom_info\": \"%s\"" ",\n\t\"charts\": {" , host->hostname , program_version , host->os , host->rrd_update_every , host->rrd_history_entries + , custom_dashboard_info_js_filename ); c = 0;