summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3b3051f)
raw | patch | inline | side by side (parent: 3b3051f)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 9 Aug 2010 20:04:54 +0000 (22:04 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 9 Aug 2010 20:04:54 +0000 (22:04 +0200) |
src/collectdctl.c | patch | blob | history | |
src/collectdctl.pod | patch | blob | history |
diff --git a/src/collectdctl.c b/src/collectdctl.c
index cc195095afe2c9601668ac3806abe44a9969a6b7..7ee90a033c99c0d942396b33af108bb04e8e17a4 100644 (file)
--- a/src/collectdctl.c
+++ b/src/collectdctl.c
#include <getopt.h>
+#include <math.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
* anyway. Also, lcc uses the type information for formatting the
* number only, so the real meaning does not matter. -tokkee */
dot = strchr (value, (int)'.');
- if (dot) { /* floating point value */
+ endptr = NULL;
+ if (strcasecmp (value, "U") == 0) {
+ values[values_len].gauge = NAN;
+ values_types[values_len] = LCC_TYPE_GAUGE;
+ }
+ else if (dot) { /* floating point value */
values[values_len].gauge = strtod (value, &endptr);
values_types[values_len] = LCC_TYPE_GAUGE;
}
diff --git a/src/collectdctl.pod b/src/collectdctl.pod
index 65d4e051cdfed71924779e8dd7936dbe3dc347ae..21c0b500c37d36c55b7d90a97674206a8065f876 100644 (file)
--- a/src/collectdctl.pod
+++ b/src/collectdctl.pod
A value list describes one data-set as handled by collectd. It is a colon
(C<:>) separated list of the time and the values. Each value is either given
as an integer if the data-type is a counter, or as a double if the data-type
-is a gauge value. The number of values and the data-types have to match the
-type specified in the identifier (see L<types.db(5)> for details). The time is
-specified as epoch (i.E<nbsp>e., standard UNIX time) or as a literal C<N>
-which will be interpreted as now.
+is a gauge value. A literal C<U> is interpreted as an undefined gauge value.
+The number of values and the data-types have to match the type specified in
+the identifier (see L<types.db(5)> for details). The time is specified as
+epoch (i.E<nbsp>e., standard UNIX time) or as a literal C<N> which will be
+interpreted as now.
=head1 EXAMPLES