X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fsnmp.c;h=3e5e381921b3ce0a483ca82def812be7cd65b5e7;hp=923a5c4f518726581dd5a654c676252556a76ebe;hb=d486225f89ea52d8ed2b4242eba2ad94c409f837;hpb=61a4ed99b1a5b6d371bb745933d0efc5dff9505c diff --git a/src/snmp.c b/src/snmp.c index 923a5c4f..3e5e3819 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -115,7 +115,7 @@ typedef struct csnmp_table_values_s csnmp_table_values_t; /* * Private variables */ -static data_definition_t *data_head = NULL; +static data_definition_t *data_head; /* * Prototypes @@ -219,7 +219,7 @@ static void csnmp_host_definition_destroy(void *arg) /* {{{ */ * +-> csnmp_config_add_host_security_level */ static void call_snmp_init_once(void) { - static int have_init = 0; + static int have_init; if (have_init == 0) init_snmp(PACKAGE_NAME); @@ -399,8 +399,7 @@ static int csnmp_config_add_data(oconfig_item_t *ci) { DEBUG("snmp plugin: dd = { name = %s, type = %s, is_table = %s, values_len = " "%" PRIsz " }", - dd->name, dd->type, (dd->is_table != 0) ? "true" : "false", - dd->values_len); + dd->name, dd->type, (dd->is_table) ? "true" : "false", dd->values_len); if (data_head == NULL) data_head = dd; @@ -599,13 +598,13 @@ static int csnmp_config_add_host(oconfig_item_t *ci) { else if (strcasecmp("Version", option->key) == 0) status = csnmp_config_add_host_version(hd, option); else if (strcasecmp("Timeout", option->key) == 0) - cf_util_get_cdtime(option, &hd->timeout); + status = cf_util_get_cdtime(option, &hd->timeout); else if (strcasecmp("Retries", option->key) == 0) - cf_util_get_int(option, &hd->retries); + status = cf_util_get_int(option, &hd->retries); else if (strcasecmp("Collect", option->key) == 0) - csnmp_config_add_host_collect(hd, option); + status = csnmp_config_add_host_collect(hd, option); else if (strcasecmp("Interval", option->key) == 0) - cf_util_get_cdtime(option, &hd->interval); + status = cf_util_get_cdtime(option, &hd->interval); else if (strcasecmp("Username", option->key) == 0) status = cf_util_get_string(option, &hd->username); else if (strcasecmp("AuthProtocol", option->key) == 0)