X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_graphite.c;h=c17b7f36a6dc787e1eeac749388f5a8f6c5e8123;hb=be0a3a6eeb3655d5559abe768c4027889d1ae979;hp=e49970c3f630dbe3fe17aecfd758417e2cb031de;hpb=4c6303ec6be673df6c9e0964dfc9419c697bf47c;p=collectd.git diff --git a/src/write_graphite.c b/src/write_graphite.c index e49970c3..c17b7f36 100644 --- a/src/write_graphite.c +++ b/src/write_graphite.c @@ -67,7 +67,7 @@ #endif #ifndef WG_DEFAULT_PROTOCOL -# define WG_DEFAULT_PROTOCOL "udp" +# define WG_DEFAULT_PROTOCOL "tcp" #endif #ifndef WG_DEFAULT_LOG_SEND_ERRORS @@ -130,11 +130,13 @@ static int wg_send_buffer (struct wg_callback *cb) status = swrite (cb->sock_fd, cb->send_buf, strlen (cb->send_buf)); if (status < 0) { + const char *protocol = cb->protocol ? cb->protocol : WG_DEFAULT_PROTOCOL; + if (cb->log_send_errors) { char errbuf[1024]; ERROR ("write_graphite plugin: send to %s:%s (%s) failed with status %zi (%s)", - cb->node, cb->service, cb->protocol, + cb->node, cb->service, protocol, status, sstrerror (errno, errbuf, sizeof (errbuf))); }