For network sockets, a port may be specified by using the form
I<address>:I<port>. The default port is 42217.
+These formats are accepted:
+
+ unix:</path/to/unix.sock>
+ </path/to/unix.sock>
+ <hostname-or-ip>
+ <hostname-or-ip>:<port>
+
If the B<-l> option is not specified the default address,
C<unix:/tmp/rrdcached.sock>, will be used.
Address of the L<rrdcached> daemon. If specified, a C<flush> command is sent
to the server before reading the RRD files. This allows B<rrdtool> to return
-fresh data even if the daemon is configured to cache values for a long time. To
-specify a UNIX domain socket use the prefix C<unix:>, see example below. Other
-addresses are interpreted as normal network addresses, i.E<nbsp>e. IPv4 or IPv6
-addresses in most cases.
+fresh data even if the daemon is configured to cache values for a long time.
+For a list of accepted formats, see the B<-l> option in the L<rrdcached> manual.
rrdtool dump --daemon unix:/var/run/rrdcached.sock /var/lib/rrd/foo.rrd
Address of the L<rrdcached> daemon. If specified, a C<flush> command is sent
to the server before reading the RRD files. This allows B<rrdtool> to return
-fresh data even if the daemon is configured to cache values for a long time. To
-specify a UNIX domain socket use the prefix C<unix:>, see example below. Other
-addresses are interpreted as normal network addresses, i.E<nbsp>e. IPv4 or IPv6
-addresses in most cases.
+fresh data even if the daemon is configured to cache values for a long time.
+For a list of accepted formats, see the B<-l> option in the L<rrdcached> manual.
rrdtool fetch --daemon unix:/var/run/rrdcached.sock /var/lib/rrd/foo.rrd AVERAGE
=item B<--daemon> I<address>
-Address of the L<rrdcached> daemon. If not specified, the RRDCACHED_ADDRESS
-environment variable must be set (see below). To specify a UNIX domain socket
-use the prefix C<unix:>, see example below. Other addresses are interpreted as
-normal network addresses, i.E<nbsp>e. IPv4 or IPv6 addresses in most cases.
+Address of the L<rrdcached> daemon. If not specified, the
+RRDCACHED_ADDRESS environment variable must be set (see below). For a
+list of accepted formats, see the B<-l> option in the L<rrdcached>
+manual.
rrdtool flush --daemon unix:/var/run/rrdcached.sock /var/lib/rrd/foo.rrd
Address of the L<rrdcached> daemon. If specified, a C<flush> command is sent
to the server before reading the RRD files. This allows the graph to contain
-fresh data even if the daemon is configured to cache values for a long time. To
-specify a UNIX domain socket use the prefix C<unix:>, see example below. Other
-addresses are interpreted as normal network addresses, i.E<nbsp>e. IPv4 or IPv6
-addresses in most cases.
+fresh data even if the daemon is configured to cache values for a long time.
+For a list of accepted formats, see the B<-l> option in the L<rrdcached> manual.
rrdtool graph [...] --daemon unix:/var/run/rrdcached.sock [...]
Address of the L<rrdcached> daemon. If specified, a C<flush> command is sent
to the server before reading the RRD files. This allows B<rrdtool> to return
-fresh data even if the daemon is configured to cache values for a long time. To
-specify a UNIX domain socket use the prefix C<unix:>, see example below. Other
-addresses are interpreted as normal network addresses, i.E<nbsp>e. IPv4 or IPv6
-addresses in most cases.
+fresh data even if the daemon is configured to cache values for a long time.
+For a list of accepted formats, see the B<-l> option in the L<rrdcached> manual.
rrdtool info --daemon unix:/var/run/rrdcached.sock /var/lib/rrd/foo.rrd
Address of the L<rrdcached> daemon. If specified, a C<flush> command is sent
to the server before reading the RRD files. This allows B<rrdtool> to return
-fresh data even if the daemon is configured to cache values for a long time. To
-specify a UNIX domain socket use the prefix C<unix:>, see example below. Other
-addresses are interpreted as normal network addresses, i.E<nbsp>e. IPv4 or IPv6
-addresses in most cases.
+fresh data even if the daemon is configured to cache values for a long time.
+For a list of accepted formats, see the B<-l> option in the L<rrdcached> manual.
rrdtool last --daemon unix:/var/run/rrdcached.sock /var/lib/rrd/foo.rrd
Address of the L<rrdcached> daemon. If specified, a C<flush> command is sent
to the server before reading the RRD files. This allows B<rrdtool> to return
-fresh data even if the daemon is configured to cache values for a long time. To
-specify a UNIX domain socket use the prefix C<unix:>, see example below. Other
-addresses are interpreted as normal network addresses, i.E<nbsp>e. IPv4 or IPv6
-addresses in most cases.
+fresh data even if the daemon is configured to cache values for a long time.
+For a list of accepted formats, see the B<-l> option in the L<rrdcached> manual.
rrdtool lastupdate --daemon unix:/var/run/rrdcached.sock /var/lib/rrd/foo.rrd
If given, B<RRDTool> will try to connect to the caching daemon L<rrdcached>
at I<address> and will fail if the connection cannot be established. If the
connection is successfully established the values will be sent to the daemon
-instead of accessing the files directly. If I<address> begins with C<unix:>
-then everything after this prefix will be considered to be a UNIX domain
-socket, see L<EXAMPLES> below. Otherwise the address is interpreted as network
-address or node name as understood by L<getaddrinfo>. One practical
-consequence is that both, IPv4 and IPv6, may be used if the system supports
-it. This option is available for the B<update> command only.
+instead of accessing the files directly.
+
+For a list of accepted formats, see the B<-l> option in the L<rrdcached> manual.
=item B<N>|I<timestamp>B<:>I<value>[B<:>I<value>...]
Address of the L<rrdcached> daemon. If specified, a C<flush> command is sent
to the server before reading the RRD files. This allows B<rrdtool> to return
-fresh data even if the daemon is configured to cache values for a long time. To
-specify a UNIX domain socket use the prefix C<unix:>, see example below. Other
-addresses are interpreted as normal network addresses, i.E<nbsp>e. IPv4 or IPv6
-addresses in most cases.
+fresh data even if the daemon is configured to cache values for a long time.
+For a list of accepted formats, see the B<-l> option in the L<rrdcached> manual.
- rrdtool xport --daemon unix:/var/run/rrdcached.sock ...
+ rrdtool xport --daemon unix:/var/run/rrdcached.sock ...
-=item B<--enumds>
+=item B<--enumds>
The generated xml should contain the data values in enumerated tags.
struct addrinfo ai_hints;
struct addrinfo *ai_res;
struct addrinfo *ai_ptr;
+ char *port;
assert (addr != NULL);
assert (sd == -1);
ai_hints.ai_family = AF_UNSPEC;
ai_hints.ai_socktype = SOCK_STREAM;
+ port = rindex(addr, ':');
+ if (port != NULL)
+ *port++ = '\0';
+
ai_res = NULL;
- status = getaddrinfo (addr, RRDCACHED_DEFAULT_PORT, &ai_hints, &ai_res);
+ status = getaddrinfo (addr,
+ port == NULL ? RRDCACHED_DEFAULT_PORT : port,
+ &ai_hints, &ai_res);
if (status != 0)
return (status);