Not able to export to CSV

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

zed22
Posts: 11
Joined: Thu Oct 11, 2007 10:51 am

Post by zed22 »

Hello,

We were also having a problem with CSV exports and came across this thread, so we upgraded to 0.8.7e and it fixed the issue.

However, I recently tried to add some color coding to one of my graph templates using the "[HOWTO] Color coded percent utilization" post at http://forums.cacti.net/about8520.html. I was actually trying to do something simpler, not with utilization but just a plain integer for upstream SNR (MER) on a cable plant.

I created these 3 new CDEFs:

1) Custom String: a,280,LT,NEGINF,UNKN,IF (for MER < 28 dB)
2) Custom String: a,300,LT,a,280,GE,NEGINF,UNKN,IF,UNKN,IF (for MER < 30 dB)
3) Custom String: a,300,GE,NEGINF,UNKN,IF (for MER > 30 dB)

I fully admit I was just using trial and error based on the extensive information in that utilization post. In the end, it all worked in the graph template and was displaying just like I hoped, but for some reason adding those CDEFs to the template broke the CSV export. If I remove the CDEFs, the CSV export works fine. While broken, it has a start and end date of 12/31/1969 4:00:00 PM and I am getting the Undefined index errors again in /var/log/httpd.

[client xxx] PHP Notice: Undefined index: start in /var/www/cacti/graph_xport.php on line 101, referer: http://xxx/cacti/graph.php?action=view& ... ph_id=9611
[client xxx] PHP Notice: Undefined index: end in /var/www/cacti/graph_xport.php on line 102, referer: http://xxx/cacti/graph.php?action=view& ... ph_id=9611
[client xxx] PHP Notice: Undefined index: step in /var/www/cacti/graph_xport.php on line 103, referer: http://xxx/cacti/graph.php?action=view& ... ph_id=9611
[client xxx] PHP Notice: Undefined index: rows in /var/www/cacti/graph_xport.php on line 104, referer: http://xxx/cacti/graph.php?action=view& ... ph_id=9611
[client xxx] PHP Notice: Undefined index: columns in /var/www/cacti/graph_xport.php on line 122, referer: http://xxx/cacti/graph.php?action=view& ... ph_id=9611
[client xxx] PHP Notice: Undefined index: data in /var/www/cacti/graph_xport.php on line 128, referer: http://xxx/cacti/graph.php?action=view& ... ph_id=9611

I am not sure if I am doing something wrong with the CDEFs or if this is a known issue. A snapshot of each graph template is attached as well as each CSV export (converted to XLS for post).

Thanks for your help.

Edit: Oops. Even though this post described the issue I am having, I just realized it is in the "Windows Specific" forum. Our cacti server is running on a CentOS 4.7 box, in case you need to move this reply or post to a new forum. Sorry :(
Attachments
Original graph template
Original graph template
snr1.gif (21.15 KiB) Viewed 4568 times
New graph template
New graph template
snr2.gif (24.74 KiB) Viewed 4568 times
up9_3_good.xls
Good CSV export
(28 KiB) Downloaded 177 times
up9_3_broken.xls
Broken CSV export
(13.5 KiB) Downloaded 167 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

1) Can't move this whole thread to the correct forum, but I could split off your post and move it if you want...

2) I just tested a CSV export with a "fire cpu usage" graph, that uses 10 CDEFs to color the graph in 10% increments. No php errors and the csv had valid data. Mind posting the graph debug output from when you try exporting the graph to CSV with and without the CDEFs which break it?
zed22
Posts: 11
Joined: Thu Oct 11, 2007 10:51 am

Post by zed22 »

You don't have to move the post unless you think it is appropriate.

Here is the graph debug output without the color coding cdefs.

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="CENTCMTB01 - Upstream MER - up9/0" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=10 \
--vertical-label="dB" \
--slope-mode \
--font TITLE:12:/usr/share/rrdtool/fonts/arial.ttf \
--font AXIS:8:/usr/share/rrdtool/fonts/arial.ttf \
--font LEGEND:8:/usr/share/rrdtool/fonts/arial.ttf \
--font UNIT:8:/usr/share/rrdtool/fonts/arial.ttf \
DEF:a="/var/www/cacti/rra/centcmtb01_snr_9472.rrd":snr:AVERAGE \
CDEF:cdefa=a,10,/ \
AREA:cdefa#4668E4FF:"MER" \
HRULE:28#FF0000FF:"" \
GPRINT:cdefa:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s" \
GPRINT:cdefa:MIN:"Minimum\:%8.2lf %s\n"

RRDTool Says:

OK

Here is the graph debug output with the color coding cdefs. The graph displays fine, it is just the CSV export that stops working.

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="CENTCMTB01 - Upstream MER - up9/0" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=10 \
--vertical-label="dB" \
--font TITLE:12:/usr/share/rrdtool/fonts/arial.ttf \
--font AXIS:8:/usr/share/rrdtool/fonts/arial.ttf \
--font LEGEND:8:/usr/share/rrdtool/fonts/arial.ttf \
--font UNIT:8:/usr/share/rrdtool/fonts/arial.ttf \
DEF:a="/var/www/cacti/rra/centcmtb01_snr_9472.rrd":snr:AVERAGE \
CDEF:cdefa=a,10,/ \
CDEF:cdeff=a,280,LT,NEGINF,UNKN,IF \
CDEF:cdefg=a,300,LT,a,280,GE,NEGINF,UNKN,IF,UNKN,IF \
CDEF:cdefh=a,300,GE,NEGINF,UNKN,IF \
AREA:cdefa#FFFFFF00:"MER" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s" \
GPRINT:cdefa:MIN:"Minimum\:%8.2lf %s\n" \
AREA:cdeff#FF0000FF:"< 28\n":STACK \
AREA:cdefg#FFFF00FF:" 28 - 30\n":STACK \
AREA:cdefh#00FF00FF:"> 30":STACK

RRDTool Says:

OK

Thanks!
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Add the following to lib/rrd.php approximately line: 1965, just before the rrdxport2array() call:

Code: Select all

cacti_log("xport $xport_opts$xport_defs$txt_xport_items", false, "WEBUI");
Post the results from your Cacti log (in human readable format). Then, run this from the command line and post the results from that as well.

I also need you to open a bug report at http://bugs.cacti.net.

Regards,

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?
zed22
Posts: 11
Joined: Thu Oct 11, 2007 10:51 am

Post by zed22 »

I was looking at my template and had a hunch about what may be causing the CSV export to break. The text formats on my CDEFs looked like this:

< 28
28 - 30
> 30

I thought the "<" and ">" signs may be messing things up. As soon as I took them out the export worked again.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Yes, those CDEF's would not work, as written. So, no bug. Good.
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
jmb
Posts: 17
Joined: Tue Jul 29, 2008 2:32 pm

Re: same problem

Post by jmb »

antifaction wrote:I can export graphs fine. But only if they have three or less data sources in them. Once there are more than three it does the same as shown above.
I've just been researching this problem here and found another cause.

We were using rrdtool 1.2.15 (per Debian 4.0 distro) and it contains a bug which breaks exports with more than 3 data sources, due to a 64-bit int/long incompatibility. rrdtool will segfault or give libc alloc errors, returning no XML, and Cacti disregards the process exit status (which ought to be fixed, of course).

http://oss.oetiker.ch/rrdtool-trac/chan ... rd_xport.c

First release with this fixed appears likely to be 1.2.24.
User avatar
jmb
Posts: 17
Joined: Tue Jul 29, 2008 2:32 pm

Re: same problem

Post by jmb »

jmb wrote:(per Debian 4.0 distro)
This is, of course, not Windows specific, despite being posted on a thread in the Windows Specific forum :)
gsaray101
Cacti User
Posts: 233
Joined: Thu May 17, 2007 9:18 am

Re: Not able to export to CSV

Post by gsaray101 »

I am having the same problem when attempting to csv export the graph data:
cacti version: 0.8.7.d
rrdtool version: 1.2.30
OS: CentOS

Code: Select all

Vertical Label:	
Start Date:	12/31/1969 19:00
End Date:	12/31/1969 19:00
Step:	
Total Rows:	
Graph ID:	29518
Host ID:	1202
	
Date	

Is this issue resolved, if yes what is the solution?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Not able to export to CSV

Post by BSOD2600 »

Cacti 0.8.7g + patches is the latest.

http://www.cacti.net/changelog.php
0.8.7e
bug#0001436: CSV Export Start Date and End Date are always 1970-01-01 01:00:00
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest