X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fsnmp.c;h=9f4714d343bd41216dfa340fd11010f110e77c72;hb=8a0163fec85502d1641757f2e3f536d498c7f2b8;hp=6a03a19dd8603adfca9b16001b7296ce1352d352;hpb=9b39918bdadabb12ec040f0f191c0d21cb6ddd53;p=collectd.git diff --git a/src/snmp.c b/src/snmp.c index 6a03a19d..9f4714d3 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -655,7 +655,10 @@ static int csnmp_config_add_host (oconfig_item_t *ci) status = cf_util_get_string(ci, &hd->name); if (status != 0) + { + sfree (hd); return status; + } hd->sess_handle = NULL; hd->interval = 0; @@ -1780,8 +1783,6 @@ static int csnmp_read_value (host_definition_t *host, data_definition_t *data) static int csnmp_read_host (user_data_t *ud) { host_definition_t *host; - cdtime_t time_start; - cdtime_t time_end; int status; int success; int i; @@ -1791,8 +1792,6 @@ static int csnmp_read_host (user_data_t *ud) if (host->interval == 0) host->interval = plugin_get_interval (); - time_start = cdtime (); - if (host->sess_handle == NULL) csnmp_host_open_session (host); @@ -1813,16 +1812,6 @@ static int csnmp_read_host (user_data_t *ud) success++; } - time_end = cdtime (); - if ((time_end - time_start) > host->interval) - { - WARNING ("snmp plugin: Host `%s' should be queried every %.3f " - "seconds, but reading all values takes %.3f seconds.", - host->name, - CDTIME_T_TO_DOUBLE (host->interval), - CDTIME_T_TO_DOUBLE (time_end - time_start)); - } - if (success == 0) return (-1);