Re: multiplicate -1

"Alex van den Bogaerdt" <[email protected]>
Newsgroups gmane.comp.db.rrdtool.user
Message-ID <E17825AADE3048E7A49302EBDE5858F8@DESK>
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.