projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed separator between prefix and the rest of the key
[collectd.git]
/
src
/
snmp.c
diff --git
a/src/snmp.c
b/src/snmp.c
index
7d6e0a1
..
51afea1
100644
(file)
--- a/
src/snmp.c
+++ b/
src/snmp.c
@@
-359,7
+359,7
@@
static int csnmp_config_add_data_blacklist(data_definition_t *dd, oconfig_item_t
{
ERROR("snmp plugin: Can't allocate memory");
strarray_free(dd->ignores, dd->ignores_len);
{
ERROR("snmp plugin: Can't allocate memory");
strarray_free(dd->ignores, dd->ignores_len);
- return (ENOMEM);
+ return (ENOMEM);
}
}
return 0;
}
}
return 0;
@@
-646,7
+646,6
@@
static int csnmp_config_add_host (oconfig_item_t *ci)
/* Registration stuff. */
char cb_name[DATA_MAX_NAME_LEN];
user_data_t cb_data;
/* Registration stuff. */
char cb_name[DATA_MAX_NAME_LEN];
user_data_t cb_data;
- struct timespec cb_interval;
hd = (host_definition_t *) malloc (sizeof (host_definition_t));
if (hd == NULL)
hd = (host_definition_t *) malloc (sizeof (host_definition_t));
if (hd == NULL)
@@
-779,11
+778,8
@@
static int csnmp_config_add_host (oconfig_item_t *ci)
cb_data.data = hd;
cb_data.free_func = csnmp_host_definition_destroy;
cb_data.data = hd;
cb_data.free_func = csnmp_host_definition_destroy;
- CDTIME_T_TO_TIMESPEC (hd->interval, &cb_interval);
-
status = plugin_register_complex_read (/* group = */ NULL, cb_name,
status = plugin_register_complex_read (/* group = */ NULL, cb_name,
- csnmp_read_host, /* interval = */ &cb_interval,
- /* user_data = */ &cb_data);
+ csnmp_read_host, hd->interval, /* user_data = */ &cb_data);
if (status != 0)
{
ERROR ("snmp plugin: Registering complex read function failed.");
if (status != 0)
{
ERROR ("snmp plugin: Registering complex read function failed.");
@@
-993,7
+989,8
@@
static value_t csnmp_value_list_to_value (struct variable_list *vl, int type,
status = parse_value (string, &ret, type);
if (status != 0)
{
status = parse_value (string, &ret, type);
if (status != 0)
{
- ERROR ("snmp plugin: csnmp_value_list_to_value: Parsing string as %s failed: %s",
+ ERROR ("snmp plugin: host %s: csnmp_value_list_to_value: Parsing string as %s failed: %s",
+ (host_name != NULL) ? host_name : "UNKNOWN",
DS_TYPE_TO_STRING (type), string);
}
}
DS_TYPE_TO_STRING (type), string);
}
}
@@
-1497,6
+1494,8
@@
static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
snmp_free_pdu (res);
res = NULL;
snmp_free_pdu (res);
res = NULL;
+ /* snmp_synch_response already freed our PDU */
+ req = NULL;
sfree (errstr);
csnmp_host_close_session (host);
sfree (errstr);
csnmp_host_close_session (host);
@@
-1544,7
+1543,8
@@
static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
if (csnmp_instance_list_add (&instance_list_head, &instance_list_tail,
res, host, data) != 0)
{
if (csnmp_instance_list_add (&instance_list_head, &instance_list_tail,
res, host, data) != 0)
{
- ERROR ("snmp plugin: csnmp_instance_list_add failed.");
+ ERROR ("snmp plugin: host %s: csnmp_instance_list_add failed.",
+ host->name);
status = -1;
break;
}
status = -1;
break;
}