summaryrefslogtreecommitdiff
path: root/daemon/rrd-update.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2008-03-02 01:25:00 +0000
committerStef Walter <stef@memberwebs.com>2008-03-02 01:25:00 +0000
commit9a78f86f773cbf34e29ec51fc06e3f04072c88d0 (patch)
tree00054e6e536769a35b4215567755494486cc36ec /daemon/rrd-update.c
parentec1a79b0f75cfd34085e046ecb30382a402ea318 (diff)
- Support failover between multiple agents
- Support table queries - Major refactoring of internals.
Diffstat (limited to 'daemon/rrd-update.c')
-rw-r--r--daemon/rrd-update.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/daemon/rrd-update.c b/daemon/rrd-update.c
index 7b43430..74e471b 100644
--- a/daemon/rrd-update.c
+++ b/daemon/rrd-update.c
@@ -45,6 +45,7 @@
#include <rrd.h>
+#include "log.h"
#include "rrdbotd.h"
#define MAX_NUMLEN 40
@@ -66,7 +67,7 @@ void rb_rrd_update(rb_poller *poll)
for(it = poll->items; it; it = it->next)
{
- tlen += strlen(it->rrdfield) + 1;
+ tlen += strlen(it->field) + 1;
ilen += 40;
}
@@ -79,7 +80,7 @@ void rb_rrd_update(rb_poller *poll)
free(items);
if(template)
free(template);
- rb_messagex(LOG_CRIT, "out of memory");
+ log_errorx ("out of memory");
return;
}
@@ -95,7 +96,7 @@ void rb_rrd_update(rb_poller *poll)
strlcat(items, ":", ilen);
}
- strlcat(template, it->rrdfield, tlen);
+ strlcat(template, it->field, tlen);
if(it->vtype == VALUE_UNSET)
strlcat(items, "U", ilen);
@@ -120,15 +121,15 @@ void rb_rrd_update(rb_poller *poll)
argv[3] = template;
argv[4] = items;
- rb_messagex(LOG_DEBUG, "updating RRD file: %s", poll->rrdname);
- rb_messagex(LOG_DEBUG, "> template: %s", template);
- rb_messagex(LOG_DEBUG, "> values: %s", items);
+ log_debug ("updating RRD file: %s", poll->rrdname);
+ log_debug ("> template: %s", template);
+ log_debug ("> values: %s", items);
rrd_clear_error();
r = rrd_update(5, (char**)argv);
if(r != 0)
- rb_messagex(LOG_ERR, "couldn't update rrd file: %s: %s",
+ log_errorx ("couldn't update rrd file: %s: %s",
poll->rrdname, rrd_get_error());
free(template);