X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fwrite_sensu.c;h=7d08fb5f6eaa311aa56d337bacf27ff232fa3bc0;hp=bda3327834cdf169945061fdf9709ac38c6e29e1;hb=48efd3deb4c9139fd060ff3d289896e9031bcc7c;hpb=d486225f89ea52d8ed2b4242eba2ad94c409f837 diff --git a/src/write_sensu.c b/src/write_sensu.c index bda33278..7d08fb5f 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -28,8 +28,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #include "utils_cache.h" #include #include @@ -309,8 +309,8 @@ static int sensu_format_name2(char *ret, int ret_len, const char *hostname, static void in_place_replace_sensu_name_reserved(char *orig_name) /* {{{ */ { - int len = strlen(orig_name); - for (int i = 0; i < len; i++) { + size_t len = strlen(orig_name); + for (size_t i = 0; i < len; i++) { // some plugins like ipmi generate special characters in metric name switch (orig_name[i]) { case '(': @@ -1084,12 +1084,8 @@ static int sensu_config_node(oconfig_item_t *ci) /* {{{ */ break; } else if (strcasecmp("Port", child->key) == 0) { status = cf_util_get_service(child, &host->service); - if (status != 0) { - ERROR("write_sensu plugin: Invalid argument " - "configured for the \"Port\" " - "option."); + if (status != 0) break; - } } else if (strcasecmp("StoreRates", child->key) == 0) { status = cf_util_get_boolean(child, &host->store_rates); if (status != 0) @@ -1225,10 +1221,10 @@ static int sensu_config(oconfig_item_t *ci) /* {{{ */ continue; status = add_str_to_list(&sensu_tags_arr, tmp); + DEBUG("write_sensu plugin: Got tag: %s", tmp); sfree(tmp); if (status != 0) continue; - DEBUG("write_sensu plugin: Got tag: %s", tmp); } else { WARNING("write_sensu plugin: Ignoring unknown " "configuration option \"%s\" at top level.",