STACK doesn't work when the stack has too many items

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

Moderators: Developers, Moderators

xaprb
Posts: 22
Joined: Thu Mar 20, 2008 12:30 pm

STACK doesn't work when the stack has too many items

Post by xaprb »

Not sure if this is an RRDTool or Cacti bug, or user error. My graph has 5 items, stacked on top of each other. The first 4 display as expected; when I change the last one from LINE1 to STACK, then the first 2 items get the same color.

Here is the command and graph with everything configured as I want it to be. Note that the first item, upon which everything else is stacked, isn't visible in the graph.

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1225900667 \
--end=1225914767 \
--title="broadway - Memory" \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
COMMENT:"From 2008/11/05 09\:57\:47 To 2008/11/05 13\:52\:47\c" \
COMMENT:"  \n" \
--vertical-label="" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memused:AVERAGE \
DEF:b="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memused:MAX \
DEF:c="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memcached:AVERAGE \
DEF:d="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memcached:MAX \
DEF:e="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_membuffer:AVERAGE \
DEF:f="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_membuffer:MAX \
DEF:g="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memshared:AVERAGE \
DEF:h="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memshared:MAX \
DEF:i="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memfree:AVERAGE \
DEF:j="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memfree:MAX \
AREA:a#850707FF:"Memused"  \
GPRINT:a:LAST:"  Cur\:%6.1lf%s"  \
GPRINT:a:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:b:MAX:"Max\:%6.1lf%s\n"  \
AREA:c#FFDB87FF:"Memcached":STACK \
GPRINT:c:LAST:"Cur\:%6.1lf%s"  \
GPRINT:c:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:d:MAX:"Max\:%6.1lf%s\n"  \
AREA:e#25345CFF:"Membuffer":STACK \
GPRINT:e:LAST:"Cur\:%6.1lf%s"  \
GPRINT:e:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:f:MAX:"Max\:%6.1lf%s\n"  \
AREA:g#88008AFF:"Memshared":STACK \
GPRINT:g:LAST:"Cur\:%6.1lf%s"  \
GPRINT:g:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:h:MAX:"Max\:%6.1lf%s\n"  \
AREA:i#4F7774FF:"Memfree":STACK \
GPRINT:i:LAST:"  Cur\:%6.1lf%s"  \
GPRINT:i:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:j:MAX:"Max\:%6.1lf%s\n" 
And here's the command when I change that last item to a LINE1:

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1225900667 \
--end=1225914767 \
--title="broadway - Memory" \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
COMMENT:"From 2008/11/05 09\:57\:47 To 2008/11/05 13\:52\:47\c" \
COMMENT:"  \n" \
--vertical-label="" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memused:AVERAGE \
DEF:b="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memused:MAX \
DEF:c="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memcached:AVERAGE \
DEF:d="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memcached:MAX \
DEF:e="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_membuffer:AVERAGE \
DEF:f="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_membuffer:MAX \
DEF:g="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memshared:AVERAGE \
DEF:h="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memshared:MAX \
DEF:i="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memfree:AVERAGE \
DEF:j="/var/www/cacti/rra/broadway_stat_membuffer_156.rrd":STAT_memfree:MAX \
AREA:a#850707FF:"Memused"  \
GPRINT:a:LAST:"  Cur\:%6.1lf%s"  \
GPRINT:a:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:b:MAX:"Max\:%6.1lf%s\n"  \
AREA:c#FFDB87FF:"Memcached":STACK \
GPRINT:c:LAST:"Cur\:%6.1lf%s"  \
GPRINT:c:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:d:MAX:"Max\:%6.1lf%s\n"  \
AREA:e#25345CFF:"Membuffer":STACK \
GPRINT:e:LAST:"Cur\:%6.1lf%s"  \
GPRINT:e:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:f:MAX:"Max\:%6.1lf%s\n"  \
AREA:g#88008AFF:"Memshared":STACK \
GPRINT:g:LAST:"Cur\:%6.1lf%s"  \
GPRINT:g:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:h:MAX:"Max\:%6.1lf%s\n"  \
LINE1:i#4F7774FF:"Memfree"  \
GPRINT:i:LAST:"  Cur\:%6.1lf%s"  \
GPRINT:i:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:j:MAX:"Max\:%6.1lf%s\n" 
I'll attach images to this post. Any ideas what's causing this? (Is it asking a leading question if I say "the total of all the items is 4GB?)
Attachments
stacked, not displaying right
stacked, not displaying right
graph_image_stack.png (33.17 KiB) Viewed 5275 times
last item changed to a line; displaying as instructed, but this isn't how I want to build the graph
last item changed to a line; displaying as instructed, but this isn't how I want to build the graph
graph_image_line.php.png (34.45 KiB) Viewed 5275 times
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Show the Graph Debug from Graph Management. That will tell you the error.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
xaprb
Posts: 22
Joined: Thu Mar 20, 2008 12:30 pm

Post by xaprb »

RRDTool says OK. There is no error. I can see the first item is being drawn as a line along the axis, i.e. at zero. Funny thing is, the second item's area extends upwards to the same height it would if it were stacked on top of the first one, so it's not as though the collapse of the first one brings everything else downwards.

I think this has to be an RRDTool bug, really. I'll try to see about getting some insight on their mailing list or something.
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

If you want to stack, you have to first have area, and then all other's will be stacks. I don't know about the 0, you may have a scaling issue to review and modify with a CDEF.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
xaprb
Posts: 22
Joined: Thu Mar 20, 2008 12:30 pm

Post by xaprb »

Sure. That's what I have. Minus the gprints,

AREA:a#850707FF:"Memused" \
AREA:c#FFDB87FF:"Memcached":STACK \
AREA:e#25345CFF:"Membuffer":STACK \
AREA:g#88008AFF:"Memshared":STACK \
AREA:i#4F7774FF:"Memfree" \
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

So, you don't want 'i' as a stack?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
xaprb
Posts: 22
Joined: Thu Mar 20, 2008 12:30 pm

Post by xaprb »

Oh, I made a manual typo there -- in the actual command it is

AREA:i#4F7774FF:"Memfree":STACK \

so yes it's supposed to be a stack.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Are you able to pm the rrd file (exported using rrdtool xport)?
Which version of rrdtool is used?
Reinhard
xaprb
Posts: 22
Joined: Thu Mar 20, 2008 12:30 pm

Post by xaprb »

I posted a bug report on RRDTool (http://oss.oetiker.ch/rrdtool-trac/ticket/195) and Tobi replied. It is not an RRD bug, it's maybe a Cacti bug (or perhaps it really is my ignorance). His reply:
as you can see, the y axis does not start at zero in yoursecond graph, this may not be what you want ... use --lower-limit 0 to force 0 to be shown.
I had totally missed that. Oops.

I will now go look into Cacti and see if there's a way to fix that, but if you have hints I'm listening, too :)
xaprb
Posts: 22
Joined: Thu Mar 20, 2008 12:30 pm

Post by xaprb »

I got it, nevermind. I'll post back when I'm sure it's solved.
xaprb
Posts: 22
Joined: Thu Mar 20, 2008 12:30 pm

Post by xaprb »

OK, so adding a lower limit fixes it. However, I think I have some bug or enhancement to suggest for Cacti, too.

It turns out that the way I had created the template, there was no lower limit or upper limit specified at all (they are blank in the web interface when trying to edit the graph template). If I try to save this as-is, it won't let me; it wants values for both input fields.

Fix #1: a template should fail to import without a lower limit and upper limit. Either that, or the web interface shouldn't require values to be filled in. You tell me what the correct behavior is :)

Next, I added a lower limit of 0, which is appropriate since there can never be less than 0 bytes of memory in a machine. For the upper limit, what should I specify? I ought to be able to leave this out -- it should not be required; some machines will have 128MB of memory and some will have 128GB. I chose a Very Large Number, and then the web interface let me save OK. Fine. I go view the graph, and it looks as I want it. Problem solved! Now I view the command used to generate the graph:

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-14400 \
--end=-300 \
--title="market - Memory" \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/cacti/rra/market_stat_membuffer_159.rrd":STAT_memused:AVERAGE \
DEF:b="/var/www/cacti/rra/market_stat_membuffer_159.rrd":STAT_memused:MAX \
DEF:c="/var/www/cacti/rra/market_stat_membuffer_159.rrd":STAT_memcached:AVERAGE \
DEF:d="/var/www/cacti/rra/market_stat_membuffer_159.rrd":STAT_memcached:MAX \
DEF:e="/var/www/cacti/rra/market_stat_membuffer_159.rrd":STAT_membuffer:AVERAGE \
DEF:f="/var/www/cacti/rra/market_stat_membuffer_159.rrd":STAT_membuffer:MAX \
DEF:g="/var/www/cacti/rra/market_stat_membuffer_159.rrd":STAT_memshared:AVERAGE \
DEF:h="/var/www/cacti/rra/market_stat_membuffer_159.rrd":STAT_memshared:MAX \
DEF:i="/var/www/cacti/rra/market_stat_membuffer_159.rrd":STAT_memfree:AVERAGE \
DEF:j="/var/www/cacti/rra/market_stat_membuffer_159.rrd":STAT_memfree:MAX \
AREA:a#850707FF:"Memused"  \
GPRINT:a:LAST:"  Cur\:%6.1lf%s"  \
GPRINT:a:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:b:MAX:"Max\:%6.1lf%s\n"  \
AREA:c#FFDB87FF:"Memcached":STACK \
GPRINT:c:LAST:"Cur\:%6.1lf%s"  \
GPRINT:c:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:d:MAX:"Max\:%6.1lf%s\n"  \
AREA:e#25345CFF:"Membuffer":STACK \
GPRINT:e:LAST:"Cur\:%6.1lf%s"  \
GPRINT:e:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:f:MAX:"Max\:%6.1lf%s\n"  \
AREA:g#88008AFF:"Memshared":STACK \
GPRINT:g:LAST:"Cur\:%6.1lf%s"  \
GPRINT:g:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:h:MAX:"Max\:%6.1lf%s\n"  \
AREA:i#4F7774FF:"Memfree":STACK \
GPRINT:i:LAST:"  Cur\:%6.1lf%s"  \
GPRINT:i:AVERAGE:"Avg\:%6.1lf%s"  \
GPRINT:j:MAX:"Max\:%6.1lf%s\n"
There's a --lower-limit, but no --upper-limit. Why was it required in the web interface, if it's not going to be sent to rrdtool on the command line?

Fix #2: the upper limit should either be optional, or removed if it's not going to be used anyway, or used if it's specified. It shouldn't be required and then ignored.

I can file bug reports on these if desired, just let me know.

Thanks for the help and the great graphing software!
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Good points. Gandolf is our Graphing Xpert :)

TheWitness
Last edited by TheWitness on Tue Nov 11, 2008 7:38 pm, edited 1 time in total.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

The requirement is (from a very short first glance) well defined. BUT

- are you using 087b? I recently added some more options to virtually allow for any combination of limits
- there's some ugly backward compatibility issue that forces us currently to do some ugly workaround when using limits. They were introduced as mandatory and defaults were provided (0 and 100, respectively), even if usually you will ignore limits. So I introduced radio boxes to select valid combinations (no limits, upper limits, lower limits, both limits)
If sth is missing still, I will head for it
Reinhard
xaprb
Posts: 22
Joined: Thu Mar 20, 2008 12:30 pm

Post by xaprb »

I'm using 0.87b, yes.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

So which exact option is missing?
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests