X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fpowerdns.c;h=8799702792f27efa34cbed6e84aa354b0fe698f4;hb=refs%2Fheads%2Fff%2Fjson;hp=164137ba39da5f9019bf037faff07efbafea1c26;hpb=619f112a584fcd89d2e8df7781a0a01341188189;p=collectd.git diff --git a/src/powerdns.c b/src/powerdns.c index 164137ba..87997027 100644 --- a/src/powerdns.c +++ b/src/powerdns.c @@ -289,30 +289,11 @@ static void submit (const char *plugin_instance, /* {{{ */ return; } - if (ds->ds[0].type == DS_TYPE_GAUGE) + if (0 != parse_value (value, &values[0], ds->ds[0].type)) { - char *endptr = NULL; - - values[0].gauge = strtod (value, &endptr); - - if (endptr == value) - { - ERROR ("powerdns plugin: Cannot convert `%s' " - "to a floating point number.", value); - return; - } - } - else - { - char *endptr = NULL; - - values[0].counter = strtoll (value, &endptr, 0); - if (endptr == value) - { - ERROR ("powerdns plugin: Cannot convert `%s' " - "to an integer number.", value); - return; - } + ERROR ("powerdns plugin: Cannot convert `%s' " + "to a number.", value); + return; } vl.values = values;