I have two integers in Cacti graph, and I would like to convert them as following:
1- Number of seconds to time format (days, hours and minutes):
e.g: 500000 -> 5 days, 18 hours, 53 minutes and 20 seconds.
2- Epoch to human readable date:
e.g: 1402971071 -> Tue, 17 Jun 2014 02:11:11
I believe that this can be done using CDEFs and GPRINT presets, but I couldn't figure it out. Can you please help me to resolved this issue.
In addition, please find below the output from rrdtool:
Code: Select all
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1399896798 \
--end=1399983198 \
--title='URL Database' \
--base=1000 \
--height=120 \
--width=600 \
--alt-autoscale-max \
--lower-limit=0 \
--units-exponent='0' \
COMMENT:"From 2014/05/12 15\:13\:18 To 2014/05/13 15\:13\:18\c" \
COMMENT:" \n" \
--vertical-label='' \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/html/cacti2/rra/database_age_106.rrd":url_database_age:AVERAGE \
DEF:b="/var/www/html/cacti2/rra/database_ver_108.rrd":url_database_ver:AVERAGE \
DEF:c="/var/www/html/cacti2/rra/database_exp_107.rrd":url_database_exp:AVERAGE \
CDEF:cdefa=a,3600,/ \
AREA:cdefa#ED7600FF:"Database Age\n" \
LINE1:cdefa#000000FF:"" \
GPRINT:cdefa:LAST:"Database Age\:\t\t%8.2lf %s\n" \
GPRINT:b:LAST:"Database Version\:\t\t%8.0lf\n" \
GPRINT:c:LAST:"Database Expiry Date\:\t%8.0lf %S"
Waleed