summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7c84372)
raw | patch | inline | side by side (parent: 7c84372)
author | Florian Forster <octo@noris.net> | |
Mon, 29 Sep 2008 12:57:38 +0000 (14:57 +0200) | ||
committer | Florian Forster <octo@noris.net> | |
Mon, 29 Sep 2008 12:57:38 +0000 (14:57 +0200) |
In big setups these messages flood the logfile and make it unreadable.
Signed-off-by: Florian Forster <octo@noris.net>
Signed-off-by: Florian Forster <octo@noris.net>
src/snmp.c | patch | blob | history |
diff --git a/src/snmp.c b/src/snmp.c
index 877aafe92b2bf959f8604916776020460b847ea2..172d668ac0851cf0b0127305ec19ee665fb35155 100644 (file)
--- a/src/snmp.c
+++ b/src/snmp.c
#include "collectd.h"
#include "common.h"
#include "plugin.h"
+#include "utils_complain.h"
#include <pthread.h>
char *community;
int version;
void *sess_handle;
+ c_complain_t complaint;
uint32_t interval;
time_t next_update;
data_definition_t **data_list;
return (-1);
memset (hd, '\0', sizeof (host_definition_t));
hd->version = 2;
+ C_COMPLAIN_INIT (&hd->complaint);
hd->name = strdup (ci->values[0].value.string);
if (hd->name == NULL)
@@ -1127,7 +1130,9 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
char *errstr = NULL;
snmp_sess_error (host->sess_handle, NULL, NULL, &errstr);
- ERROR ("snmp plugin: host %s: snmp_sess_synch_response failed: %s",
+
+ c_complain (LOG_ERR, &host->complaint,
+ "snmp plugin: host %s: snmp_sess_synch_response failed: %s",
host->name, (errstr == NULL) ? "Unknown problem" : errstr);
if (res != NULL)
@@ -1142,6 +1147,9 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
}
status = 0;
assert (res != NULL);
+ c_release (LOG_INFO, &host->complaint,
+ "snmp plugin: host %s: snmp_sess_synch_response successful.",
+ host->name);
vb = res->variables;
if (vb == NULL)