summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1f65ab0)
raw | patch | inline | side by side (parent: 1f65ab0)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 25 Sep 2008 15:25:51 +0000 (15:25 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 25 Sep 2008 15:25:51 +0000 (15:25 +0000) |
Obviously this is required to take advantage of the server's ability to
bind to a non-standard port -- kevin brintnall
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1522 a5681a0c-68f1-0310-ab6d-d61299d08faa
bind to a non-standard port -- kevin brintnall
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1522 a5681a0c-68f1-0310-ab6d-d61299d08faa
index 0f34dc20549b3dff4e5db5f191f0c5f973081f81..bdb8949a893eaf589c364f739fbccbb907920137 100644 (file)
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.
index 89e378bca1994a3a2b1ace4b89fc76cbde686d8c..c26d31bcad288a85883dac2710dafce5ec3287e2 100644 (file)
--- a/program/doc/rrddump.pod
+++ b/program/doc/rrddump.pod
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
index d187b69e9db48b0152bfa519d71dabc187002b66..0052aa6513b1a82b351d5e705cc5fd185f78d090 100644 (file)
--- a/program/doc/rrdfetch.pod
+++ b/program/doc/rrdfetch.pod
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
index f691c2113bd958debd13c98e1f98a4fef4df07da..a59382124973d9646757a8756cc10a67c30e87e4 100644 (file)
--- a/program/doc/rrdflush.pod
+++ b/program/doc/rrdflush.pod
=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
index 2c57dbb156b7e1687e8f04916273bf2cb05e3de2..9a2f752d46cb8b1449c82093e2c1b2372b9093a3 100644 (file)
--- a/program/doc/rrdgraph.pod
+++ b/program/doc/rrdgraph.pod
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 [...]
index 2af411a5595a61694c233288e383d2525ec3a21d..00e5d165aaed969e21fd06740a19379d1798dd07 100644 (file)
--- a/program/doc/rrdinfo.pod
+++ b/program/doc/rrdinfo.pod
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
index ecec65a949df966f8b416259ec4bf0548249e0bc..a8bf7574bb461cc922551341aaf40699818e60da 100644 (file)
--- a/program/doc/rrdlast.pod
+++ b/program/doc/rrdlast.pod
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
index db506abd0559a3264c0efea38dbc8bbb656bee6d..ecdff8da9ade95d5ff7bbcfec55301215a6a350b 100644 (file)
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
index 82c66037279439760745cb895f30a4661658e2d5..c285ee372545e02595607c12a3445d01ebe64916 100644 (file)
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>...]
index 11159e479fbe47d15f1e4e86b0654efec4224b9e..d7e6bb34616e9a4c76a75e0b168136e0f76adf04 100644 (file)
--- a/program/doc/rrdxport.pod
+++ b/program/doc/rrdxport.pod
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.
index 11fb80dc19cb25135c277ca68a8d234deeb0bbc3..c573dad308dd75892951ced112d63f0daa4324bb 100644 (file)
--- a/program/src/rrd_client.c
+++ b/program/src/rrd_client.c
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);