GPRINT error - returns zero value when set to Exact Numbers
Moderators: Developers, Moderators
GPRINT error - returns zero value when set to Exact Numbers
Hello,
I've written a data query to return some information that we would like to graph. This works absolutely fine, and in the past I've had this working with cacti.
I've added this data source into a simple graph which should output the numerical values via GPRINT from the script at the bottom of the graph.
If I set the GPRINT Type to either Exact Numbers or Normal, then the graph will only output "0".
If this is changed back to Load Average, we start to get output to two decimal places?
How can I get this working as whole numbers?
Can anyone help
Thanks
I've written a data query to return some information that we would like to graph. This works absolutely fine, and in the past I've had this working with cacti.
I've added this data source into a simple graph which should output the numerical values via GPRINT from the script at the bottom of the graph.
If I set the GPRINT Type to either Exact Numbers or Normal, then the graph will only output "0".
If this is changed back to Load Average, we start to get output to two decimal places?
How can I get this working as whole numbers?
Can anyone help
Thanks
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: GPRINT error - returns zero value when set to Exact Numb
Please post the output from Graph Management for the given graph when switching to DEBUG mode for both types of graph
R.
R.
Re: GPRINT error - returns zero value when set to Exact Numb
## With GPRINT (current) set to Exact numbers ##
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Codian MCU001' \
--base=1000 \
--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/lib/cacti/rra/mcu001_vid_use1_13.rrd":vid_use1:AVERAGE \
DEF:b="/var/lib/cacti/rra/mcu001_vid_use1_13.rrd":vid_use1:MAX \
COMMENT:"Video usage\n" \
GPRINTLAST:"Current\:%8.0lf" \
GPRINTAVERAGE:"Average\:%8.2lf %s" \
GPRINTMAX:"Maximum\:%8.2lf %s\n" \
LINE2:a#FF0000FF:"Average" RRDTool Says:
RRDTool Says:
OK
## With GPRINT (current) set to Load average ##
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Codian MCU001' \
--base=1000 \
--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/lib/cacti/rra/mcu001_vid_use1_13.rrd":vid_use1:AVERAGE \
DEF:b="/var/lib/cacti/rra/mcu001_vid_use1_13.rrd":vid_use1:MAX \
COMMENT:"Video usage\n" \
GPRINTLAST:"Current\:%8.2lf" \
GPRINTAVERAGE:"Average\:%8.2lf %s" \
GPRINTMAX:"Maximum\:%8.2lf %s\n" \
LINE2:a#FF0000FF:"Average" RRDTool Says:
RRDTool Says:
OK
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Codian MCU001' \
--base=1000 \
--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/lib/cacti/rra/mcu001_vid_use1_13.rrd":vid_use1:AVERAGE \
DEF:b="/var/lib/cacti/rra/mcu001_vid_use1_13.rrd":vid_use1:MAX \
COMMENT:"Video usage\n" \
GPRINTLAST:"Current\:%8.0lf" \
GPRINTAVERAGE:"Average\:%8.2lf %s" \
GPRINTMAX:"Maximum\:%8.2lf %s\n" \
LINE2:a#FF0000FF:"Average" RRDTool Says:
RRDTool Says:
OK
## With GPRINT (current) set to Load average ##
RRDTool Command:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='Codian MCU001' \
--base=1000 \
--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/lib/cacti/rra/mcu001_vid_use1_13.rrd":vid_use1:AVERAGE \
DEF:b="/var/lib/cacti/rra/mcu001_vid_use1_13.rrd":vid_use1:MAX \
COMMENT:"Video usage\n" \
GPRINTLAST:"Current\:%8.2lf" \
GPRINTAVERAGE:"Average\:%8.2lf %s" \
GPRINTMAX:"Maximum\:%8.2lf %s\n" \
LINE2:a#FF0000FF:"Average" RRDTool Says:
RRDTool Says:
OK
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: GPRINT error - returns zero value when set to Exact Numb
That looks fine. It won't work for numbers < 1. Which numbers do you want to GPRINT?
R.
R.
Re: GPRINT error - returns zero value when set to Exact Numb
Currently the script is out putting numbers >5
And still it shows as zero
And still it shows as zero
Re: GPRINT error - returns zero value when set to Exact Numb
And if I set the Avg and Max GPRINT functions to Round numbers.. they also then start to show as zero.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: GPRINT error - returns zero value when set to Exact Numb
Would it be possible to email that very rrd file?
R.
R.
Re: GPRINT error - returns zero value when set to Exact Numb
In order to email it across, I would need to check the content of the file first (security policy here )
What tool can decode it, as it can't be read as clear text?
Edit.
I've dumped it out to xml via rrdtool - what email address please?
What tool can decode it, as it can't be read as clear text?
Edit.
I've dumped it out to xml via rrdtool - what email address please?
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: GPRINT error - returns zero value when set to Exact Numb
That's indeed the required format. Please use the email address provided underneath each of my posts; gzip the file before posting, pleasegaryb wrote:I've dumped it out to xml via rrdtool - what email address please?
R.
Re: GPRINT error - returns zero value when set to Exact Numb
File sent.
Thanks!
Thanks!
Re: GPRINT error - returns zero value when set to Exact Numb
Did you get my email gandalf ?
Thanks
Thanks
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: GPRINT error - returns zero value when set to Exact Numb
Yep, but need more time. Not before end of weekend.
R.
R.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: GPRINT error - returns zero value when set to Exact Numb
I just verified in production environment, that the basic idea is working. So I need to find out, in which way your environment is "special" ...
R.
R.
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
Re: GPRINT error - returns zero value when set to Exact Numb
Unfortunately, this statement is NOT correct. Next time I will request a screenshot. I'll attach what I've created with your rrd file.garyb wrote:Currently the script is out putting numbers >5
And still it shows as zero
Do you see the "m", denoting "milli" == "1/1000"?
So, your numbers are indeed below 1. Printing the integer part of such a number indeed yields 0.
R.
- Attachments
-
- cacti.png (14.63 KiB) Viewed 1834 times
Re: GPRINT error - returns zero value when set to Exact Numb
I beg to differ... Unless I'm not understanding.
Here is the latest log entry from cacti.log - showing the script returning a value of 26
Here is the latest log entry from cacti.log - showing the script returning a value of 26
Code: Select all
04/23/2012 10:30:03 AM - CMDPHP: Poller[0] Host[2] DS[13] CMD: sh /usr/share/cacti/site/scripts/Scrape-mcu001.sh <ipaddress> <username> <password>, output: vid_use1:26
Who is online
Users browsing this forum: No registered users and 0 guests