BUGS in version 0.95a!!!

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
Ptica79
Posts: 3
Joined: Tue Mar 11, 2008 9:40 am

BUGS in version 0.95a!!!

Post by Ptica79 »

If I yse clear install, i can't add conf in view.
In log i have error:

Code: Select all

03/11/2008 04:56:19 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1364', SQL:"insert into weathermap_maps (configfile,titlecache,active,imagefile,htmlfile) VALUES ('test.conf','TEST','on','','')'
If i inser this string in mysql CLI, i have error:

Code: Select all

mysql>
mysql> insert into weathermap_maps (configfile,titlecache,active,imagefile,htmlfile) VALUES ('test.conf','(no title)','on','','');
ERROR 1364 (HY000): Field 'filehash' doesn't have a default value
mysql> quit
In setup.php

Code: Select all

	if (!in_array('weathermap_maps', $tables)) {
		$sql[] = "CREATE TABLE weathermap_maps (
			id int(11) NOT NULL auto_increment,
			sortorder int(11) NOT NULL default 0,
			active set('on','off') NOT NULL efault 'on',
			configfile text NOT NULL,
			imagefile text NOT NULL,
			htmlfile text NOT NULL,
			titlecache text NOT NULL,
			filehash varchar (40) NOT NULL,   <=== THIS !!!!
			warncount int(11) NOT NULL default 0,
			config text NOT NULL,    <===== AND THIS !!!!
			PRIMARY KEY  (id)
		) TYPE=MyISAM;";
	}
What default need set for this?

filehash varchar (40) NOT NULL and config text NOT NULL is new in table, but in insert in weathermap-cacti-plugin-mgmt.php (450-453) not supported:

Code: Select all

		$file = mysql_real_escape_string($file);
		$title = mysql_real_escape_string($title);
		$SQL = "insert into weathermap_maps (configfile,titlecache,active,imagefile,htmlfile) VALUES ('$file','$title','on','','')";
		db_execute($SQL);
Last edited by Ptica79 on Tue Mar 11, 2008 4:15 pm, edited 1 time in total.
Ptica79
Posts: 3
Joined: Tue Mar 11, 2008 9:40 am

Post by Ptica79 »

Other BUG in cacti-pick.php.
When edit map if click on link and click on [Pick from Cacti] all work. But if click on node, click on [Pick from Cacti] and click on graph - you not have return.

For link html code like this:

Code: Select all

<li class="row1"><a href="#" onclick="update_source_step1('22','<path_rra>/cisco_3750_errors_in_22.rrd')">Cisco 3750 - Errors - 10.60.114.101 - Tu0</a></li>
<li class="row0"><a href="#" onclick="update_source_step1('23','<path_rra>/cisco_3750_errors_in_23.rrd')">Cisco 3750 - Errors - 10.60.114.129 - Tu1</a></li>
But for node:

Code: Select all

<li class="row1"><a href="#" onclick="update_source_step1('23')">Cisco 3750 - Errors - Gi1/0/1</a></li>
<li class="row0"><a href="#" onclick="update_source_step1('24')">Cisco 3750 - Errors - Gi1/0/2</a></li>
And update_source_step1 not processed correctli.

In cacti-pick.php for link code (253-261):

Code: Select all

		foreach ($queryrows as $line) {
			//while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
			echo "<li class=\"row".($i%2)."\">";
			$key = $line['local_data_id']."','".$line['data_source_path']; <==== THIS!!!!
			echo "<a href=\"#\" onclick=\"update_source_step1('$key')\">". $line['name_cache'] . "</a>";
			echo "</li>\n";
			
			$i++;
		}
For node code (440-448):

Code: Select all

		foreach ($queryrows as $line) {
			//while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
			echo "<li class=\"row".($i%2)."\">";
			$key = $line['local_graph_id']; <==== THIS!!!
			echo "<a href=\"#\" onclick=\"update_source_step1('$key')\">". $line['title_cache'] . "</a>";
			echo "</li>\n";
			$i++;
		}
How fix this?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Ptica79 wrote:Other BUG in cacti-pick.php.
When edit map if click on link and click on [Pick from Cacti] all work. But if click on node, click on [Pick from Cacti] and click on graph - you not have return.

For link html code like this:

Code: Select all

<li class="row1"><a href="#" onclick="update_source_step1('22','<path_rra>/cisco_3750_errors_in_22.rrd')">Cisco 3750 - Errors - 10.60.114.101 - Tu0</a></li>
<li class="row0"><a href="#" onclick="update_source_step1('23','<path_rra>/cisco_3750_errors_in_23.rrd')">Cisco 3750 - Errors - 10.60.114.129 - Tu1</a></li>
But for node:

Code: Select all

<li class="row1"><a href="#" onclick="update_source_step1('23')">Cisco 3750 - Errors - Gi1/0/1</a></li>
<li class="row0"><a href="#" onclick="update_source_step1('24')">Cisco 3750 - Errors - Gi1/0/2</a></li>
And update_source_step1 not processed correctli.

In cacti-pick.php for link code (253-261):

Code: Select all

		foreach ($queryrows as $line) {
			//while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
			echo "<li class="row".($i%2)."">";
			$key = $line['local_data_id']."','".$line['data_source_path']; <==== THIS!!!!
			echo "<a href="#" onclick="update_source_step1('$key')">". $line['name_cache'] . "</a>";
			echo "</li>\n";
			
			$i++;
		}
For node code (440-448):

Code: Select all

		foreach ($queryrows as $line) {
			//while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
			echo "<li class="row".($i%2)."">";
			$key = $line['local_graph_id']; <==== THIS!!!
			echo "<a href="#" onclick="update_source_step1('$key')">". $line['title_cache'] . "</a>";
			echo "</li>\n";
			$i++;
		}
How fix this?
There are TWO update_source_step1 javascript functions. You get a different function for links and for nodes. They take different arguments because the node picker doesn't update any TARGET, only the infourl and overlibgraph. That's why the node picker shows graphs, and the link picker shows data sources.

HOWEVER, there is an error in the cacti-pick.php in two places. Where it loads the jquery library, it loads it from the wrong place.

The two lines that read

Code: Select all

        <script type="text/javascript" src="lib/javascript/jquery-latest.pack.js"></script>
should read

Code: Select all

<script type="text/javascript" src="editor-resources/jquery-latest.pack.js"></script>
instead. I moved this file to seperate out web-accessible javascript for the editor from non-web-accessible php libraries for the rest of weathermap.
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!)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: BUGS in version 0.95a!!!

Post by Howie »

Ptica79 wrote:If I yse clear install, i can't add conf in view.
In log i have error:

Code: Select all

03/11/2008 04:56:19 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1364', SQL:"insert into weathermap_maps (configfile,titlecache,active,imagefile,htmlfile) VALUES ('test.conf','TEST','on','','')'
If i inser this string in mysql CLI, i have error:

Code: Select all

mysql>
mysql> insert into weathermap_maps (configfile,titlecache,active,imagefile,htmlfile) VALUES ('test.conf','(no title)','on','','');
ERROR 1364 (HY000): Field 'filehash' doesn't have a default value
mysql> quit
In setup.php

Code: Select all

	if (!in_array('weathermap_maps', $tables)) {
		$sql[] = "CREATE TABLE weathermap_maps (
			id int(11) NOT NULL auto_increment,
			sortorder int(11) NOT NULL default 0,
			active set('on','off') NOT NULL efault 'on',
			configfile text NOT NULL,
			imagefile text NOT NULL,
			htmlfile text NOT NULL,
			titlecache text NOT NULL,
			filehash varchar (40) NOT NULL,   <=== THIS !!!!
			warncount int(11) NOT NULL default 0,
			config text NOT NULL,    <===== AND THIS !!!!
			PRIMARY KEY  (id)
		) TYPE=MyISAM;";
	}
What default need set for this?
They should both be ''.

In fact for a 0.94 user, you do get the correct filehash, because the alter table command a little further on is correct :oops:

Oddly, I don't actually get an error for any of this stuff, which works fine for me with an empty install. Obviously something different between our MySQL versions.


filehash varchar (40) NOT NULL and config text NOT NULL is new in table, but in insert in weathermap-cacti-plugin-mgmt.php (450-453) not supported:

Code: Select all

		$file = mysql_real_escape_string($file);
		$title = mysql_real_escape_string($title);
		$SQL = "insert into weathermap_maps (configfile,titlecache,active,imagefile,htmlfile) VALUES ('$file','$title','on','','')";
		db_execute($SQL);
That's correct. config text is not used yet and filehash is updated from elsewhere (in setup.php). warncount isn't used yet, either. The intention was that in a future version, the Weathermap manage screen could show you which maps had problems last time they were run.

It looks like there will be a 0.95b with more fixes like this :-( and then I will rethink how I develop weathermap.
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!)
cecfos
Posts: 5
Joined: Tue Apr 08, 2008 9:17 am

Post by cecfos »

Hi,
I have the same problem like you.
I user cacti 0.8.7a, PA 2.0, weathermap 0.95b. php 5.2.5. mysql 5.1.22.
I have two type of error messages:
CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1064', SQL:"REPLACE INTO settings (name, value) VALUES ('url_path', '\cacti\')'

And when i try to had a new map:
CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1364',
SQL:"insert int weathermap into weathermap_maps (configfile, titlecache, active,imagefile,htmlfile) VALUES ('simple.conf','Reseau\r','on','','')'

Cacti seems to works good. Graphs are normals. But i have no map in weathermap.
Thanks for your help
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

cecfos wrote:Hi,
I have the same problem like you.
I user cacti 0.8.7a, PA 2.0, weathermap 0.95b. php 5.2.5. mysql 5.1.22.
I have two type of error messages:
CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1064', SQL:"REPLACE INTO settings (name, value) VALUES ('url_path', '\cacti\')'
This one looks like you have the wrong setting for url_path in global.php or similar... it's not Weathermap. (I don't think those should be backslashes \ but forward slashes /).
And when i try to had a new map:
CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1364',
SQL:"insert int weathermap into weathermap_maps (configfile, titlecache, active,imagefile,htmlfile) VALUES ('simple.conf','Reseau\r','on','','')'

Cacti seems to works good. Graphs are normals. But i have no map in weathermap.
Thanks for your help
This is a different problem too, but it IS weathermap :-)

Looks like somehow weathermap is getting some weird characters out of the TITLE from the map config. To prove that, could you temporarily take the TITLE line out of your map config file and try again?
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!)
cecfos
Posts: 5
Joined: Tue Apr 08, 2008 9:17 am

Post by cecfos »

Thanks for your answer

I delete the line TITLE of my map. The same error message appear with '(no title)'
It doesn't work! sorry
cecfos
Posts: 5
Joined: Tue Apr 08, 2008 9:17 am

Post by cecfos »

I update to cacti 0.8.7b and it don't change nothing!
i don't understand...
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Code: Select all

SQL:"insert int weathermap into weathermap
^^^^^^^^^^^^^^^^^^^^^^
I just noticed this. Does it really say weathermap twice like that? I think you might have some kind of file corruption there if it does.
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!)
cecfos
Posts: 5
Joined: Tue Apr 08, 2008 9:17 am

Post by cecfos »

sorry it's an error of me. (my server cacti is on an another pc and i made a mistake when a type it)
i have exactly the same error message than Ptica79.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Ah OK. I thought I had fixed this between 0.95 and 0.95b, but...

Please change line 452 of weathermap-cacti-plugin-mgmt.php to:

Code: Select all

$SQL = "insert into weathermap_maps (configfile,titlecache,active,imagefile,htmlfile,filehash,config) VALUES ('$file','$title','on','','','','')";
Hopefully that will stop the error for you.
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!)
cecfos
Posts: 5
Joined: Tue Apr 08, 2008 9:17 am

Post by cecfos »

Hi
I just made the test and it seems to be ok.
i wish it was the solution.
thanks a lot.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests