summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bd70209)
raw | patch | inline | side by side (parent: bd70209)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 19 Dec 2008 17:20:41 +0000 (18:20 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 19 Dec 2008 17:20:41 +0000 (18:20 +0100) |
The only exception to that is during configuration (which is done before
daemonization) to let the user know about problems immediately.
daemonization) to let the user know about problems immediately.
src/common.c | patch | blob | history | |
src/email.c | patch | blob | history | |
src/ipmi.c | patch | blob | history | |
src/rrdtool.c | patch | blob | history | |
src/utils_dns.c | patch | blob | history |
diff --git a/src/common.c b/src/common.c
index 82b4aaae87745b0e6afb5ca4e1004d9c2de8647a..8dbf976f11a9fc526a30350965e6d5d2bd54a58a 100644 (file)
--- a/src/common.c
+++ b/src/common.c
#else
if (ksp == NULL)
{
- fprintf (stderr, "ERROR: %s:%i: ksp == NULL\n", __FILE__, __LINE__);
+ ERROR ("ERROR: %s:%i: ksp == NULL\n", __FILE__, __LINE__);
return (-1LL);
}
else if (ksp->ks_type != KSTAT_TYPE_NAMED)
{
- fprintf (stderr, "ERROR: %s:%i: ksp->ks_type != KSTAT_TYPE_NAMED\n", __FILE__, __LINE__);
+ ERROR ("ERROR: %s:%i: ksp->ks_type != KSTAT_TYPE_NAMED\n", __FILE__, __LINE__);
return (-1LL);
}
#endif
diff --git a/src/email.c b/src/email.c
index 0882ad46299b5d118494c0407c7f4a9a0f17a9cb..cc68d3fc0f0471a1b10492ca83093f9c3c4e07bc 100644 (file)
--- a/src/email.c
+++ b/src/email.c
fprintf (stderr, "email plugin: `MaxConns' was set to invalid "
"value %li, will use default %i.\n",
tmp, MAX_CONNS);
+ ERROR ("email plugin: `MaxConns' was set to invalid "
+ "value %li, will use default %i.\n",
+ tmp, MAX_CONNS);
max_conns = MAX_CONNS;
}
else if (tmp > MAX_CONNS_LIMIT) {
fprintf (stderr, "email plugin: `MaxConns' was set to invalid "
"value %li, will use hardcoded limit %i.\n",
tmp, MAX_CONNS_LIMIT);
+ ERROR ("email plugin: `MaxConns' was set to invalid "
+ "value %li, will use hardcoded limit %i.\n",
+ tmp, MAX_CONNS_LIMIT);
max_conns = MAX_CONNS_LIMIT;
}
else {
diff --git a/src/ipmi.c b/src/ipmi.c
index 956aaf44c25cc3bf659e02e7768bca6268449f24..2d6d2485a27c40e75a40e12646b696adf813e0c9 100644 (file)
--- a/src/ipmi.c
+++ b/src/ipmi.c
{
int status;
- printf ("domain_connection_change_handler (domain = %p, err = %i, "
+ DEBUG ("domain_connection_change_handler (domain = %p, err = %i, "
"conn_num = %u, port_num = %u, still_connected = %i, "
"user_data = %p);\n",
(void *) domain, err, conn_num, port_num, still_connected, user_data);
status = thread_init (&os_handler);
if (status != 0)
{
- fprintf (stderr, "ipmi plugin: thread_init failed.\n");
+ ERROR ("ipmi plugin: thread_init failed.\n");
return ((void *) -1);
}
diff --git a/src/rrdtool.c b/src/rrdtool.c
index 3b2c54fc9265bb49c05618164af4dc7d8f8ce121..ac81d55cf96a34d93608102b69030eab0143f698 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
{
fprintf (stderr, "rrdtool: `CacheTimeout' must "
"be greater than 0.\n");
+ ERROR ("rrdtool: `CacheTimeout' must "
+ "be greater than 0.\n");
return (1);
}
cache_timeout = tmp;
{
fprintf (stderr, "rrdtool: `CacheFlush' must "
"be greater than 0.\n");
+ ERROR ("rrdtool: `CacheFlush' must "
+ "be greater than 0.\n");
return (1);
}
cache_flush_timeout = tmp;
{
fprintf (stderr, "rrdtool: `RRARows' must "
"be greater than 0.\n");
+ ERROR ("rrdtool: `RRARows' must "
+ "be greater than 0.\n");
return (1);
}
rrarows = tmp;
if (tmp_alloc == NULL)
{
fprintf (stderr, "rrdtool: realloc failed.\n");
+ ERROR ("rrdtool: realloc failed.\n");
free (value_copy);
return (1);
}
{
fprintf (stderr, "rrdtool: `XFF' must "
"be in the range 0 to 1 (exclusive).");
+ ERROR ("rrdtool: `XFF' must "
+ "be in the range 0 to 1 (exclusive).");
return (1);
}
xff = tmp;
diff --git a/src/utils_dns.c b/src/utils_dns.c
index 46e6018e80407faac028192b14793e4a12188336..5316a71aefc6bae6bb840e4616013146a37384ff 100644 (file)
--- a/src/utils_dns.c
+++ b/src/utils_dns.c
*/
#include "collectd.h"
+#include "plugin.h"
#if HAVE_NETINET_IN_SYSTM_H
# include <netinet/in_systm.h>
memcpy(&us, buf + 2, 2);
us = ntohs(us);
- fprintf (stderr, "Bytes 0, 1: 0x%04hx\n", us);
qh.qr = (us >> 15) & 0x01;
qh.opcode = (us >> 11) & 0x0F;
qh.aa = (us >> 10) & 0x01;
@@ -648,7 +648,7 @@ void handle_pcap(u_char *udata, const struct pcap_pkthdr *hdr, const u_char *pkt
{
int status;
- fprintf (stderr, "handle_pcap (udata = %p, hdr = %p, pkt = %p): hdr->caplen = %i\n",
+ DEBUG ("handle_pcap (udata = %p, hdr = %p, pkt = %p): hdr->caplen = %i\n",
(void *) udata, (void *) hdr, (void *) pkt,
hdr->caplen);
@@ -685,7 +685,7 @@ void handle_pcap(u_char *udata, const struct pcap_pkthdr *hdr, const u_char *pkt
break;
default:
- fprintf (stderr, "unsupported data link type %d\n",
+ ERROR ("handle_pcap: unsupported data link type %d\n",
pcap_datalink(pcap_obj));
status = 0;
break;