summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c7e5d54)
raw | patch | inline | side by side (parent: c7e5d54)
author | Florian Forster <octo@huhu.verplant.org> | |
Thu, 4 Oct 2007 06:44:41 +0000 (08:44 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Thu, 4 Oct 2007 06:44:41 +0000 (08:44 +0200) |
src/snmp.c | patch | blob | history |
diff --git a/src/snmp.c b/src/snmp.c
index 3c8a4fcb88299dea02357f76c24377e355f20f83..0c2b79afa2892bf26f6cbc46acc71195c7f772a0 100644 (file)
--- a/src/snmp.c
+++ b/src/snmp.c
@@ -1103,10 +1103,12 @@ static int csnmp_read_value (host_definition_t *host, data_definition_t *data)
for (vb = res->variables; vb != NULL; vb = vb->next_variable)
{
+#if COLLECT_DEBUG
char buffer[1024];
snprint_variable (buffer, sizeof (buffer),
vb->name, vb->name_length, vb);
DEBUG ("snmp plugin: Got this variable: %s", buffer);
+#endif /* COLLECT_DEBUG */
for (i = 0; i < data->values_len; i++)
if (snmp_oid_compare (data->values[i].oid, data->values[i].oid_len,
@@ -1126,8 +1128,12 @@ static int csnmp_read_value (host_definition_t *host, data_definition_t *data)
static int csnmp_read_host (host_definition_t *host)
{
int i;
+ time_t time_start;
+ time_t time_end;
- DEBUG ("snmp plugin: csnmp_read_host (%s);", host->name);
+ time_start = time (NULL);
+ DEBUG ("snmp plugin: csnmp_read_host (%s) started at %u;", host->name,
+ (unsigned int) time_start);
if (host->sess_handle == NULL)
csnmp_host_open_session (host);
csnmp_read_value (host, data);
}
+ time_end = time (NULL);
+ DEBUG ("snmp plugin: csnmp_read_host (%s) at %u;", host->name,
+ (unsigned int) time_end);
+ if ((time_end - time_start) > host->skip_num)
+ {
+ WARNING ("snmp plugin: Host `%s' should be queried every %i seconds, "
+ "but reading all values takes %i seconds.",
+ host->name, host->skip_num, time_end - time_start);
+ }
+
return (0);
} /* int csnmp_read_host */