X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwrite_sensu.c;h=67c04969227302c4f7f81dc0bafa2016587bd32a;hb=246ed363bda10ab0fd00059b0820f441e1b09268;hp=268d9e44bb3d4da256b1a6b8390cd56e1578003e;hpb=1c4008c3216edbc9c7cbeffd1c597c9b32e8f64d;p=collectd.git diff --git a/src/write_sensu.c b/src/write_sensu.c index 268d9e44..67c04969 100644 --- a/src/write_sensu.c +++ b/src/write_sensu.c @@ -29,7 +29,6 @@ #include "common.h" #include "configfile.h" #include "utils_cache.h" -#include #include #include #include @@ -329,7 +328,7 @@ static char *sensu_value_to_json(struct sensu_host const *host, /* {{{ */ { char name_buffer[5 * DATA_MAX_NAME_LEN]; char service_buffer[6 * DATA_MAX_NAME_LEN]; - int i; + size_t i; char *ret_str; char *temp_str; char *value_str; @@ -641,7 +640,7 @@ static char *sensu_notification_to_json(struct sensu_host *host, /* {{{ */ char *ret_str; char *temp_str; int status; - int i; + size_t i; int res; // add the severity/status switch (n->severity) { @@ -883,7 +882,7 @@ static int sensu_write(const data_set_t *ds, /* {{{ */ int statuses[vl->values_len]; struct sensu_host *host = ud->data; gauge_t *rates = NULL; - int i; + size_t i; char *msg; pthread_mutex_lock(&host->lock); @@ -897,7 +896,7 @@ static int sensu_write(const data_set_t *ds, /* {{{ */ return -1; } } - for (i = 0; i < (size_t) vl->values_len; i++) { + for (i = 0; i < vl->values_len; i++) { msg = sensu_value_to_json(host, ds, vl, (int) i, rates, statuses[i]); if (msg == NULL) { sfree(rates); @@ -1172,7 +1171,7 @@ static int sensu_config(oconfig_item_t *ci) /* {{{ */ continue; } if (child->values[0].type != OCONFIG_TYPE_STRING || - child->values[1].type != OCONFIG_TYPE_STRING) { + child->values[1].type != OCONFIG_TYPE_STRING) { WARNING("sensu attribute needs string arguments."); continue; } @@ -1180,7 +1179,9 @@ static int sensu_config(oconfig_item_t *ci) /* {{{ */ strarray_add(&sensu_attrs, &sensu_attrs_num, child->values[0].value.string); strarray_add(&sensu_attrs, &sensu_attrs_num, child->values[1].value.string); - DEBUG("write_sensu: got attr: %s => %s", key, val); + DEBUG("write_sensu plugin: New attribute: %s => %s", + child->values[0].value.string, + child->values[1].value.string); } else if (strcasecmp(child->key, "tag") == 0) { char *tmp = NULL; status = cf_util_get_string(child, &tmp);