RPN Stack Underflow

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

Moderators: Developers, Moderators

Post Reply
mikesphar
Posts: 6
Joined: Wed Apr 19, 2006 6:18 pm
Location: Chicago, IL

RPN Stack Underflow

Post by mikesphar »

I've been working on getting the w32 disk statistics working, and after much futzing with the various templates I seem to be stuck.

At this point I'm getting an "RPN stack underflow" error from rrdtool in the graph debug output:

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="mikeyserver - Disk - C:" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="Unit" \
--slope-mode \
DEF:a="/var/www/esspub/cacti/rra/mikeyserver_freemegabytes_182.rrd":PercentDiskReadTime:LAST \
DEF:b="/var/www/esspub/cacti/rra/mikeyserver_freemegabytes_182.rrd":PercentDiskWriteTim:LAST \
DEF:c="/var/www/esspub/cacti/rra/mikeyserver_freemegabytes_182.rrd":AvgDiskReadQueueLen:LAST \
DEF:d="/var/www/esspub/cacti/rra/mikeyserver_freemegabytes_182.rrd":AvgDiskWriteQueueLe:LAST \
DEF:e="/var/www/esspub/cacti/rra/mikeyserver_freemegabytes_182.rrd":AvgDiskReadPerSec:LAST \
DEF:f="/var/www/esspub/cacti/rra/mikeyserver_freemegabytes_182.rrd":AvgDiskWritePerSec:LAST \
DEF:g="/var/www/esspub/cacti/rra/mikeyserver_freemegabytes_182.rrd":PercentFreeSpace:LAST \
DEF:h="/var/www/esspub/cacti/rra/mikeyserver_freemegabytes_182.rrd":FreeMegabytes:LAST \
CDEF:cdefbb=h,1024,/,/ \
CDEF:cdefci=h,1048576,/ \
AREA:a#FF6044:"Read Time(%)"  \
AREA:b#00BED9:"Write Time(%)"  \
LINE1:c#F5F800:"Read Queue\:"  \
LINE1:d#00FF00:"Write Queue\:\n"  \
LINE1:e#0000FF:"Read /s\:"  \
LINE1:f#DE0056:"Write /s"  \
LINE1:g#000000:"Free Space (%)\n"  \
COMMENT:"Statistics"  \
GPRINT:a:LAST:"  Read\: (%1.1lf %%)"  \
GPRINT:b:LAST:"Write\: (%1.1lf %%)"  \
GPRINT:g:LAST:"Free\: (%1.1lf %%)"  \
GPRINT:cdefbb:LAST:"Available\: %5.2lf Gb\n"  \
COMMENT:"Read IO / sec\:"  \
GPRINT:e:LAST:"Current\:%8.0lf"  \
GPRINT:e:AVERAGE:"Average\:%8.0lf"  \
GPRINT:e:MAX:"Maximum\:%8.0lf\n"  \
COMMENT:"Write IO / sec\:"  \
GPRINT:f:LAST:"Current\:%8.0lf"  \
GPRINT:f:AVERAGE:"Average\:%8.0lf"  \
GPRINT:f:MAX:"Maximum\:%8.0lf\n"  \
COMMENT:"Read  Queue\:"  \
GPRINT:c:LAST:"Current\:%8.0lf"  \
GPRINT:c:AVERAGE:"Average\:%8.0lf"  \
GPRINT:c:MAX:"Maximum\:%8.0lf\n"  \
COMMENT:"Write Queue\:"  \
GPRINT:d:LAST:"Current\:%8.0lf"  \
GPRINT:d:AVERAGE:"Average\:%8.0lf"  \
GPRINT:d:MAX:"Maximum\:%8.0lf\n"  \
LINE1:cdefci#FFFFFF:"" 
RRDTool Says:

ERROR: RPN stack underflow
It's probably staring me in the face but I'm not seeing where this RPN error is coming from.

Edit: Okay, after more detective work, I tracked down the problem item to item #12: GPRINT:cdefbb:LAST:"Available\: %5.2lf Gb\n" \

I set the CDEF function for that item in the graph template to None, and now I don't get the rpn error anymore, so that's something at least.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

The line

Code: Select all

CDEF:cdefbb=h,1024,/,/ \ 
is weird. Should possibly look like

Code: Select all

CDEF:cdefbb=h,1024,/ \ 
. So please check this CDEF
Reinhard
mikesphar
Posts: 6
Joined: Wed Apr 19, 2006 6:18 pm
Location: Chicago, IL

Post by mikesphar »

Yeah, that did seem to be it. I"m not even sure what that CDEF is supposed to be doing in that template. It's called "Kilobytes to Megabytes", but the data source it was being applied to is already being reported in Megabytes. I made a new "Megabytes to Gigabytes" CDEF and applied that instead.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

What it does? It divides the given datasource by 1024
Reinhard
mikesphar
Posts: 6
Joined: Wed Apr 19, 2006 6:18 pm
Location: Chicago, IL

Post by mikesphar »

Yeah, I understood what it literally did, I just wasn't sure why it was being applied to that data source.

Then I thought about it some more, and of course, converting KB to MB is the same formula as converting MB to GB. The one I created myself just worked right because it didn't have that wierd format that was imported from the template.

Thanks for the help!
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests