status = rrdc_connect (daemon_address);
if (status != 0)
{
- char *err = rrd_get_error ();
ERROR ("rrdcached plugin: Failed to reconnect to RRDCacheD "
- "at %s: %s (status=%d)", daemon_address, err, status);
+ "at %s: %s (status=%d)", daemon_address, rrd_get_error (), status);
return (-1);
}
sstrncpy (vl.host, daemon_address, sizeof (vl.host));
sstrncpy (vl.plugin, "rrdcached", sizeof (vl.plugin));
+ rrd_clear_error ();
status = rrdc_connect (daemon_address);
if (status != 0)
{
- char *err = rrd_get_error ();
ERROR ("rrdcached plugin: Failed to connect to RRDCacheD "
- "at %s: %s (status=%d)", daemon_address, err, status);
+ "at %s: %s (status=%d)", daemon_address, rrd_get_error (), status);
return (-1);
}
/* The RRD client lib does not provide any means for checking a
* connection, hence we'll have to retry upon failed operations. */
head = NULL;
+ rrd_clear_error ();
status = rrdc_stats_get (&head);
if (status == 0)
break;
/* else: report the error and fail */
}
- ERROR ("rrdcached plugin: rrdc_stats_get failed with status %i.", status);
+ ERROR ("rrdcached plugin: rrdc_stats_get failed: %s (status=%i).",
+ rrd_get_error (), status);
return (-1);
}
}
}
+ rrd_clear_error ();
status = rrdc_connect (daemon_address);
if (status != 0)
{
- char *err = rrd_get_error ();
ERROR ("rrdcached plugin: Failed to connect to RRDCacheD "
- "at %s: %s (status=%d)", daemon_address, err, status);
+ "at %s: %s (status=%d)", daemon_address, rrd_get_error (), status);
return (-1);
}
{
/* The RRD client lib does not provide any means for checking a
* connection, hence we'll have to retry upon failed operations. */
+ rrd_clear_error ();
status = rrdc_update (filename, /* values_num = */ 1, (void *) values_array);
if (status == 0)
break;
/* else: report the error and fail */
}
- ERROR ("rrdcached plugin: rrdc_update (%s, [%s], 1) failed with "
- "status %i.",
- filename, values_array[0], status);
+ ERROR ("rrdcached plugin: rrdc_update (%s, [%s], 1) failed: %s (status=%i)",
+ filename, values_array[0], rrd_get_error (), status);
return (-1);
}
else
ssnprintf (filename, sizeof (filename), "%s.rrd", identifier);
+ rrd_clear_error ();
status = rrdc_connect (daemon_address);
if (status != 0)
{
- char *err = rrd_get_error ();
ERROR ("rrdcached plugin: Failed to connect to RRDCacheD "
- "at %s: %s (status=%d)", daemon_address, err, status);
+ "at %s: %s (status=%d)", daemon_address, rrd_get_error (), status);
return (-1);
}
{
/* The RRD client lib does not provide any means for checking a
* connection, hence we'll have to retry upon failed operations. */
+ rrd_clear_error ();
status = rrdc_flush (filename);
if (status == 0)
break;
/* else: report the error and fail */
}
- ERROR ("rrdcached plugin: rrdc_flush (%s) failed with status %i.",
- filename, status);
+ ERROR ("rrdcached plugin: rrdc_flush (%s) failed: %s (status=%i).",
+ filename, rrd_get_error (), status);
return (-1);
}
DEBUG ("rrdcached plugin: rrdc_flush (%s): Success.", filename);