Possible bug ..?

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

Moderators: Developers, Moderators

Post Reply
VampireFE
Posts: 3
Joined: Fri Aug 28, 2009 3:54 am

Possible bug ..?

Post by VampireFE »

Hello there.

I think I found a bug guys. Ofc I've only played with Cacti for 2 days, so I'm noob with this, but I'm gonna post anyways :)

The problem was that there were no graphics showing when I added devices & graphs to the database. The reason was that RRDTool didn't create the database files (so far it seems to be the reason, anyways).

I checked the debug messages and found this:

Code: Select all

C:/Install/RRDTool/rrdtool-1.2.30-bin-w32/rrdtool/rrdtool.exe create \
C:/Program Files/wamp/www/cacti/rra/6/18.rrd \
--step 300  \
DS:snmp_oid:GAUGE:600:0:100 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
The problem is lack of quotes ("") for file path. There is a whitespace char there, so they are required. I took a look at source files and in rrd.php, function rrdtool_function_create, I hotfixed this by adding them here:

Code: Select all

rrdtool_execute("create \"$data_source_path\" $create_ds$create_rra", true, RRDTOOL_OUTPUT_STDOUT, $rrd_struc, "POLLER");
There also seemed to be a problem that with debug messages enabled, it only showed the code, but didn't execute it. So I added rrdtool_execute to the condition branch when $show_source == true, like this:

Code: Select all

	if ($show_source == true) {
		rrdtool_execute("create \"$data_source_path\" $create_ds$create_rra", true, RRDTOOL_OUTPUT_STDOUT, $rrd_struc, "POLLER");
		return read_config_option("path_rrdtool") . " create" . RRD_NL . "\"$data_source_path\"$create_ds$create_rra";
	}else{
		rrdtool_execute("create \"$data_source_path\" $create_ds$create_rra", true, RRDTOOL_OUTPUT_STDOUT, $rrd_struc, "POLLER");
	}
There are still some issues for me, but at least now the .rrd files are created where they are supposed to :)

Not sure if those fixes were really needed, probably it's a case of "it's not a bug, it's a feature", but at least now I'm getting empty graphics showing up instead of 'no picture' icons.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I thought it said somewhere in the install docs that you shouldn't use paths with a space in, but I can't find that, and I think that it's a cop-out really not to be able to handle it. Good fix :-)
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
VampireFE
Posts: 3
Joined: Fri Aug 28, 2009 3:54 am

Post by VampireFE »

Heh, now that you mention it, yes - it is written there bunch of times :D

Gotta admit, I didn't follow install guide, since I had 90% of the tools already on my computer :/ Guess I'll have to battle more spaces in the future.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Yup, cacti doesn't like spaces.

You can try using the 8.3 name instead...
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests