Page 1 of 1

RRD Conversion

Posted: Fri Dec 21, 2018 4:16 am
by danniiffxi
Hi Ladies and Gentlemen

First off I want to wish you all a very Merry Christmas and a Happy New Year, and I apologise if this has been mentioned in a previous thread but I am far to lazy to read every post on the forum, I have found a few similar but none that ask exactly what I am about too.

OK so what I am trying to do it convert the RRD timestamp into a human readable format. So after dumping the graph to the CSV I can open the spreadsheet and use a simple formula to convert the EPOCH/UNIX time & date to human readable. What I need to do next has me stuck and headbutting my keyboard in frustration :roll: .. What I need to do is convert the graph output results from "4.00000e-02" into "0.04" for example. Does anyone know how this can be done, there has to be a way because Nagios does it when applying the results to the graphs.

The plan is to make a pretty dashboard for the management which is to be built in PowerBI, because we all know they love pretty graphs at their meetings without the hassle of actually logging into a Nagios and searching for what they need

Re: RRD Conversion

Posted: Fri Dec 21, 2018 3:31 pm
by ssax
This should work, you don't say what language you're using so I went with bash:

Code: Select all

#!/bin/bash
SCIENTIFIC='4.00000e-02'
DECIMAL=$(printf "%.2f" $SCIENTIFIC)
echo $DECIMAL
exit 0

Re: RRD Conversion

Posted: Tue Jan 22, 2019 8:19 am
by danniiffxi
Thank you ssax, sorry for the late reply, I had complete forgot about this thread due to the Christmas break. I was wondering more about a CSV conversion but bash will be fine.

Many thanks.

Re: RRD Conversion

Posted: Wed Jan 23, 2019 4:32 pm
by scottwilkerson
danniiffxi wrote:Thank you ssax, sorry for the late reply, I had complete forgot about this thread due to the Christmas break. I was wondering more about a CSV conversion but bash will be fine.

Many thanks.
May we close the thread?

Re: RRD Conversion

Posted: Thu Jan 24, 2019 5:25 am
by danniiffxi
Sure, go for it :)

Re: RRD Conversion

Posted: Thu Jan 24, 2019 7:37 am
by scottwilkerson
danniiffxi wrote:Sure, go for it :)
Locking thread