]> git.itanic.dy.fi Git - rrdd/commitdiff
built_in_parsers: Remove digitemp parser
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Wed, 26 Oct 2016 17:54:38 +0000 (20:54 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Wed, 26 Oct 2016 17:54:38 +0000 (20:54 +0300)
There are no users for this parser. Onewire parser replaces this one.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
built_in_parsers.c

index 9a0d342cf2d9c749994fc3b07a8ab8f0268ffcf2..cce3f66865ab210b59c408792f61d5dfabb30aaa 100644 (file)
@@ -117,52 +117,6 @@ int cpu_mem_parser(char *data, const char **p)
        return 0;
 }
 
        return 0;
 }
 
-static int digitemp_parser(char *data, const char **p)
-{
-       const char digitemp_cmd[] = "/usr/bin/digitemp";
-       char *const digitemp_args[] = { "", "-o2", "-a", "-q", 0 };
-       FILE *readf;
-       int pid, ret;
-       float t1 = 0, t2 = 0, t3 = 0;
-       char buf[1024];
-
-       pid = run_piped_stream(digitemp_cmd, digitemp_args, 0, &readf, 0);
-       if (pid < 0) {
-               pr_err("Failed to parse digitemp\n");
-               sprintf(data, "U:U");
-               return -1;
-       }
-
-       ret = fscanf(readf, "%f %f %f", &t1, &t2, &t3);
-
-       if (ret != 3) {
-               pr_err("Failed to parse digitemp output: %m\n");
-               sprintf(data, "U:U");
-               return 1;
-       }
-
-       t2 += 2.16;
-       t3 += -0.44;
-
-       /* Read whatever the process might be still printing out */
-       while (fgets(buf, 1024, readf));
-
-       clear_zombie(pid);
-       snprintf(data, RRD_DATA_MAX_LEN, "%.2f:%.2f", t3, t2);
-       return 0;
-}
-
-static int digitemp_parser_mod(char *data, const char **p)
-{
-       char buf[1024];
-       int ret;
-
-       ret = digitemp_parser(buf, p);
-       snprintf(data, RRD_DATA_MAX_LEN, "U:%s", buf);
-
-       return ret;
-}
-
 /* Run a command and feed the output from stdout directly to rrdtool */
 static int script_parser(char *rrd_data, const char **parser_data)
 {
 /* Run a command and feed the output from stdout directly to rrdtool */
 static int script_parser(char *rrd_data, const char **parser_data)
 {
@@ -299,14 +253,6 @@ static struct parser_info built_in_parsers[] = {
                .name = "cpu_mem",
                .parse = cpu_mem_parser,
        },
                .name = "cpu_mem",
                .parse = cpu_mem_parser,
        },
-       {
-               .name = "digitemp",
-               .parse = digitemp_parser,
-       },
-       {
-               .name = "digitemp_mod",
-               .parse = digitemp_parser_mod,
-       },
        {
                .name = "script",
                .parse = script_parser,
        {
                .name = "script",
                .parse = script_parser,