CDEF to remove decimal for RRD Graph?
Moderators: Developers, Moderators
CDEF to remove decimal for RRD Graph?
Hey there,
I am creating a graph from a source that typically puts out numbers such as 13413.5456642154522413 I am getting the error: Error: not a simple integer: 13413.5456642154522413
I've done a lot of searching on here, and found that other people have run into the issue, but not so much on resolving it. I tried to create a CDEF that took the current_data_source and applied the FLOOR function to it, then applied that to each one of the items on my graph template, but it doesn't appear to fix the problem.
Anyone else resolve this issue before?
I am creating a graph from a source that typically puts out numbers such as 13413.5456642154522413 I am getting the error: Error: not a simple integer: 13413.5456642154522413
I've done a lot of searching on here, and found that other people have run into the issue, but not so much on resolving it. I tried to create a CDEF that took the current_data_source and applied the FLOOR function to it, then applied that to each one of the items on my graph template, but it doesn't appear to fix the problem.
Anyone else resolve this issue before?
Thanks for the response, Reinhard.
Here is the requested output:
c:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Mencken - Traffic" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per second" \
DEF:a="C\:/Inetpub/wwwroot/cacti/rra/mencken_traffic_in_256.rrd":traffic_in:AVERAGE \
CDEF:cdefa=a,FLOOR \
AREA:cdefa#00CF00:"Total Bytes" \
GPRINT:cdefa:LAST:"Current\:%8.0lf" \
GPRINT:cdefa:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefa:MAX:"Maximum\:%8.0lf" \
COMMENT:"Total: 4.32 GB\n"
RRDTool Says:
OK
Here is the requested output:
c:/rrdtool/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Mencken - Traffic" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per second" \
DEF:a="C\:/Inetpub/wwwroot/cacti/rra/mencken_traffic_in_256.rrd":traffic_in:AVERAGE \
CDEF:cdefa=a,FLOOR \
AREA:cdefa#00CF00:"Total Bytes" \
GPRINT:cdefa:LAST:"Current\:%8.0lf" \
GPRINT:cdefa:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefa:MAX:"Maximum\:%8.0lf" \
COMMENT:"Total: 4.32 GB\n"
RRDTool Says:
OK
Why have you changed the default CDEF output? the default should be have "8.2lf %"
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
What rrdtool version? That 8.2f should've limited it to 2 decimal places.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
Just updated to RRDTool 1.2.15
I removed all the extras from the CDEF... except Bytes to Bits:
RRDTool Command:
c:/rrdtool2/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Traffic" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per second" \
--slope-mode \
DEF:a="C\:/Inetpub/wwwroot/cacti/rra/traffic_in_256.rrd":traffic_in:AVERAGE \
CDEF:cdefa=a,8,* \
AREA:cdefa#00CF00:"Total Bytes" \
GPRINT:cdefa:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"Total\: 0 bytes\n"
RRDTool Says:
OK
Still getting a NAN for the graph -- the cacti log does not show an error in polling, but I still get something like the following when running the poller:
OK u:0.19 s:0.38 r:2.73
OK u:0.19 s:0.38 r:2.73
OK u:0.19 s:0.38 r:2.75
ERROR: not a simple integer: '2379.09991593749'
OK u:0.19 s:0.38 r:2.75
OK u:0.19 s:0.39 r:2.77
OK u:0.19 s:0.39 r:2.77
And then of course, the graph isn't updated.
I removed all the extras from the CDEF... except Bytes to Bits:
RRDTool Command:
c:/rrdtool2/rrdtool.exe graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Traffic" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per second" \
--slope-mode \
DEF:a="C\:/Inetpub/wwwroot/cacti/rra/traffic_in_256.rrd":traffic_in:AVERAGE \
CDEF:cdefa=a,8,* \
AREA:cdefa#00CF00:"Total Bytes" \
GPRINT:cdefa:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s" \
COMMENT:"Total\: 0 bytes\n"
RRDTool Says:
OK
Still getting a NAN for the graph -- the cacti log does not show an error in polling, but I still get something like the following when running the poller:
OK u:0.19 s:0.38 r:2.73
OK u:0.19 s:0.38 r:2.73
OK u:0.19 s:0.38 r:2.75
ERROR: not a simple integer: '2379.09991593749'
OK u:0.19 s:0.38 r:2.75
OK u:0.19 s:0.39 r:2.77
OK u:0.19 s:0.39 r:2.77
And then of course, the graph isn't updated.
Are you running custom scripts to return the data? Turn the logging level in cacti to medium or high. What data query does the 2379.09991593749 type values come from?
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
No custom scripts, I'm just directly pulling the value from an OID via SNMP.
One note: It is pulling this digit, and lists it as a STRING: instead of a Counter64: or Integer:, etc.. should that matter?
02/18/2008 01:44:03 PM - POLLER: Poller[0] CACTI2RRD: c:/rrdtool2/rrdtool.exe update C:\Inetpub\wwwroot\cacti\rra\traffic_in_256.rrd --template traffic_in 1203371039:11458.592182769
02/18/2008 01:45:08 PM - POLLER: Poller[0] CACTI2RRD: c:/rrdtool2/rrdtool.exe update C:\Inetpub\wwwroot\cacti\rra\traffic_in_256.rrd --template traffic_in 1203371104:23014.8761223344
That is the poller running twice in a row..
One note: It is pulling this digit, and lists it as a STRING: instead of a Counter64: or Integer:, etc.. should that matter?
02/18/2008 01:44:03 PM - POLLER: Poller[0] CACTI2RRD: c:/rrdtool2/rrdtool.exe update C:\Inetpub\wwwroot\cacti\rra\traffic_in_256.rrd --template traffic_in 1203371039:11458.592182769
02/18/2008 01:45:08 PM - POLLER: Poller[0] CACTI2RRD: c:/rrdtool2/rrdtool.exe update C:\Inetpub\wwwroot\cacti\rra\traffic_in_256.rrd --template traffic_in 1203371104:23014.8761223344
That is the poller running twice in a row..
Also, here is a direct snmpget to that OID:
SNMPv2-SMI::enterprises.15.69.6.90.2 = STRING: "17170.4285860183"
It appears that the poller is not inserting the value into the RRD file at all. I think I may be looking to fix this in the wrong place. I don't think I have a graphing problem, but instead a poller issue, where the poller will not insert this long decimal placed number into the RRD file. The RRD file is actually just full of NANs
SNMPv2-SMI::enterprises.15.69.6.90.2 = STRING: "17170.4285860183"
It appears that the poller is not inserting the value into the RRD file at all. I think I may be looking to fix this in the wrong place. I don't think I have a graphing problem, but instead a poller issue, where the poller will not insert this long decimal placed number into the RRD file. The RRD file is actually just full of NANs
I believe this is the problemmalken00 wrote:One note: It is pulling this digit, and lists it as a STRING: instead of a Counter64: or Integer:, etc.. should that matter?
Google for 'rrdtool not a simple integer', and you'll find lots of others with this issue.
| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
COUNTERs are clean integers by definition. GAUGEs may be floats. If anyone implemented a COUNTER to spit out floats instead of integers and then used STRING to avoid the COUNTER issue, this would simple be weird. RRDTool does not like it. If you need to get this solved, IMHO the only chance is to write a wrapper that rounds/cuts off decimals and to call this wrapper from cacti
Reinhard
Reinhard
Who is online
Users browsing this forum: No registered users and 5 guests