RRDtools and save output of queries
RRDtools and save output of queries