diff options
Diffstat (limited to 'libnetdata/config/appconfig.c')
-rw-r--r-- | libnetdata/config/appconfig.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libnetdata/config/appconfig.c b/libnetdata/config/appconfig.c index 0272877bf2..56e703e35d 100644 --- a/libnetdata/config/appconfig.c +++ b/libnetdata/config/appconfig.c @@ -805,6 +805,18 @@ void appconfig_generate(struct config *root, BUFFER *wb, int only_changed) struct section *co; struct config_option *cv; + { + int found_host_labels = 0; + for (co = root->first_section; co; co = co->next) + if(!strcmp(co->name, CONFIG_SECTION_HOST_LABEL)) + found_host_labels = 1; + + if(!found_host_labels) { + appconfig_section_create(root, CONFIG_SECTION_HOST_LABEL); + appconfig_get(root, CONFIG_SECTION_HOST_LABEL, "name", "value"); + } + } + buffer_strcat(wb, "# netdata configuration\n" "#\n" |