This parser will simply run some command and assume the command writes
the rrd tool data as is to stdout.
Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
return ret;
}
+
+/* Run a command and feed the output from stdout directly to rrdtool */
+int script_parser(char *rrd_data, void *parser_data)
+{
+ FILE *readf;
+ char **cmd = parser_data;
+ int pid, ret;
+
+ pid = run_piped_stream(cmd[0], &cmd[1], NULL, &readf, NULL);
+ ret = fread(rrd_data, RRD_DATA_MAX_LEN, 1, readf);
+
+ pr_info("Read :%s\n", rrd_data);
+ fclose(readf);
+
+ harvest_zombies(pid);
+
+ return 0;
+}
int cpu_mem_parser(char *data, void *p);
int digitemp_parser(char *data, void *p);
int digitemp_parser_mod(char *data, void *p);
+int script_parser(char *rrd_data, void *parser_data);
#endif