Graphing Negative Numbers

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
tclaydon
Posts: 12
Joined: Wed Jun 04, 2003 6:11 pm
Location: Oklahoma City, OK
Contact:

Graphing Negative Numbers

Post by tclaydon »

Hello all,

I'm running the latest version on my FreeBSD box, and everything seems to be working fine. Until...

I am graphing RSSI (signal) levels from an Access Point to other customers off of this AP. The signal levels are stored in dB, which is represented as a negative number (-65, -88, etc.) But, the graph is being shown with nothing on it:

Image

Here's the output from rrdtool:

/usr/local/rrdtool-1.0.40/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--title="Trango AP - North Sector Customer RSSI" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="RSSI (dB)" \
DEF:a="/usr/local/bin/apache/htdocs/cacti/rra/trango_ap__north_sector_trango_rssi_2_73.rrd":trango_rssi_2:AVERAGE \
DEF:b="/usr/local/bin/apache/htdocs/cacti/rra/trango_ap__north_sector_omnipack_rssi_79.rrd":omnipack_rssi:AVERAGE \
DEF:c="/usr/local/bin/apache/htdocs/cacti/rra/trango_ap__north_sector_opubcobh_rssi_77.rrd":opubcobh_rssi:AVERAGE \
DEF:d="/usr/local/bin/apache/htdocs/cacti/rra/trango_ap__north_sector_javadaves_rssi_75.rrd":javadaves_rssi:AVERAGE \
CDEF:cdefa=a,300,* \
CDEF:cdefb=b,300,* \
CDEF:cdefc=c,300,* \
CDEF:cdefd=d,300,* \
LINE1:cdefa#FF5700:"4D Networks" \
LINE1:cdefb#EA8F00:"Omni Packaging" \
LINE1:cdefc#00CF00:"OPUBCO Backhaul" \
LINE1:cdefd#4444FF:"Java Daves"

...and here's the output from rrd.log:

06/04/2003 6:20 PM - CMD: /usr/local/rrdtool-1.0.40/bin/rrdtool update /usr/local/bin/apache/htdocs/cacti/rra/trango_ap__north_sector_trango_rssi_2_73.rrd --template trango_rssi_2 N:-64
06/04/2003 6:20 PM - CMD: /usr/local/rrdtool-1.0.40/bin/rrdtool update /usr/local/bin/apache/htdocs/cacti/rra/trango_ap__north_sector_javadaves_rssi_75.rrd --template javadaves_rssi N:-67
06/04/2003 6:20 PM - CMD: /usr/local/rrdtool-1.0.40/bin/rrdtool update /usr/local/bin/apache/htdocs/cacti/rra/trango_ap__north_sector_opubcobh_rssi_77.rrd --template opubcobh_rssi N:-69
06/04/2003 6:20 PM - CMD: /usr/local/rrdtool-1.0.40/bin/rrdtool update /usr/local/bin/apache/htdocs/cacti/rra/trango_ap__north_sector_omnipack_rssi_79.rrd --template omnipack_rssi N:-77

As you can see, the numbers are being correctly read.

I searched the archives, and the other fixes for this type of problem were for previous versions, so no dice there.

Anyone know how to fix this? Or point me to where I'm goofing up?

Thanks,

= TC[/img]
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

Two things:

1) I noticed the --lower-limit on your graph is set to '0'. You may want to try setting that to something lower to see if that makes a difference. You also may want to try to use '--alt-autoscale' over '--alt-autoscale-max'.

2) Check the data source that you created to represent this data. Make sure it has a reasonable "Minimum Value" set (not 0). If you do end up changing this field, make sure you delete the .rrd file associated with this data source, or the change will not take effect.

-Ian
tclaydon
Posts: 12
Joined: Wed Jun 04, 2003 6:11 pm
Location: Oklahoma City, OK
Contact:

Post by tclaydon »

OK, here's what I've got so far:

I changed the "Minimum Value" set on the data sources to -100, and then deleted the old .rrd files associated with these sources.

In "Graph Management", I selected the graph. I cannot put a negative value for lower limit, with or without the checkbox for "Auto Scale". If I try and give Lower Limit a negative value, it gives me a "Field Input Error", and won't let me save the changes.

Any ideas?

Thanks again,

= TC[/img]
tclaydon
Posts: 12
Joined: Wed Jun 04, 2003 6:11 pm
Location: Oklahoma City, OK
Contact:

Post by tclaydon »

Oh, one other thing... :roll:

You'll notice the values are anywhere between -60 and -80, which is correct. But look at the values on the left-hand side of the chart, and they're not at the correct values (-20.0K)!

Any ideas?

= TC
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

About the y-axis legend. You might be able to change this by changing the "Unit Exponent Value" in graph management. And about not being able to enter negative numbers for the upper and lower limit, this was an oversight on my part and has been fixed.

If you need anything else, let me know.

-Ian
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Exponent Value will not help in this case. Your mistake is using CDEF function called "Make Per 5 Minutes" for each of your graph lines. This causes the signal level presented to be multiplied by 300 and therefore you observe around -20K values. You have not used this function for your GPRINT items so this is the reason that correct values are presented below the graph.

- bulek
tclaydon
Posts: 12
Joined: Wed Jun 04, 2003 6:11 pm
Location: Oklahoma City, OK
Contact:

Post by tclaydon »

bulek wrote:Exponent Value will not help in this case. Your mistake is using CDEF function called "Make Per 5 Minutes" for each of your graph lines. This causes the signal level presented to be multiplied by 300 and therefore you observe around -20K values. You have not used this function for your GPRINT items so this is the reason that correct values are presented below the graph.

- bulek
Bulek - thank you! :D That was the problem. Once I removed that CDEF from those items, the graphs finally turned out right (as you can see from the top of the page).

Rax - You said you fixed the min value problem -- can you post the code fix so I can tweak my copy?

Thanks,

= TC
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest