Discussion:
[rrd-users] multiplicate -1
(too old to reply)
Martin
2015-03-20 15:13:46 UTC
Permalink
Hello,

Im re-learning rrdtool so i started with a simple ping graph, now i
think i remember i could create 2 areas for 2 ping hosts if i
multiplicated the result with *-1 i tested to add this in the script
that updates the .rrd

(ping -c 3 -w 6 www.google.com | grep rtt | awk -F "/" '{ print $5*-1 }' )
and it will return "-11.87" although in the graph it comes out as a
positive result and graphs upwards when it should graph in a negative area

Im trying to google and read since i have a faint memory of that you
could miltiplicate the info it feteches from the .rrd when you create
the graph.

anyone got an idea or can dropkick me to the right doc to read.

cheers
/M
Alex van den Bogaerdt
2015-03-20 15:43:08 UTC
Permalink
Im re-learning rrdtool so i started with a simple ping graph, now i think
i remember i could create 2 areas for 2 ping hosts if i multiplicated the
result with *-1 i tested to add this in the script that updates the .rrd
(ping -c 3 -w 6 www.google.com | grep rtt | awk -F "/" '{ print $5*-1 }' )
and it will return "-11.87" although in the graph it comes out as a
positive result and graphs upwards when it should graph in a negative area
Test what you feed RRDtool.
You probably have a script which calls "rrdtool name.rrd $data" or similar.
Duplicate that line and prepend "echo " to it, and append " >> rrdlog.txt"

Also rtfm of awk. ... | grep ... | awk ... is (almost?) always too much,
as awk can do what you let grep do.
From memory: awk -F "/" '/rtt/{print $5}'
Im trying to google and read since i have a faint memory of that you could
miltiplicate the info it feteches from the .rrd when you create the graph.
CDEF is your friend here: CDEF:negated=orig,-1,*
and then of course graph negated.

HTH
Alex

Loading...