|
|
| Author |
Message |
Ptica79
Joined: 11 Mar 2008 Posts: 3
|
Posted: Tue Mar 11, 2008 9:59 am Post subject: BUGS in version 0.95a!!! |
|
|
If I yse clear install, i can't add conf in view.
In log i have error:
| Code: |
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: |
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: |
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: |
$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 |
|
| Back to top |
|
 |
Ptica79
Joined: 11 Mar 2008 Posts: 3
|
Posted: Tue Mar 11, 2008 4:14 pm Post subject: |
|
|
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: |
<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: |
<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: |
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: |
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? |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Tue Mar 11, 2008 7:21 pm Post subject: |
|
|
| 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: |
<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: |
<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: |
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: |
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: |
<script type="text/javascript" src="lib/javascript/jquery-latest.pack.js"></script>
|
should read
| Code: |
<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. |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Tue Mar 11, 2008 7:34 pm Post subject: Re: BUGS in version 0.95a!!! |
|
|
| Ptica79 wrote: | If I yse clear install, i can't add conf in view.
In log i have error:
| Code: |
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: |
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: |
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
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.
| Quote: |
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: |
$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. |
|
| Back to top |
|
 |
cecfos
Joined: 08 Apr 2008 Posts: 5
|
Posted: Tue Apr 08, 2008 9:23 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Tue Apr 08, 2008 9:47 am Post subject: |
|
|
| 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 /).
| Quote: |
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? |
|
| Back to top |
|
 |
cecfos
Joined: 08 Apr 2008 Posts: 5
|
Posted: Tue Apr 08, 2008 10:51 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
cecfos
Joined: 08 Apr 2008 Posts: 5
|
Posted: Tue Apr 08, 2008 11:57 am Post subject: |
|
|
I update to cacti 0.8.7b and it don't change nothing!
i don't understand... |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Tue Apr 08, 2008 3:36 pm Post subject: |
|
|
| Code: |
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. |
|
| Back to top |
|
 |
cecfos
Joined: 08 Apr 2008 Posts: 5
|
Posted: Tue Apr 08, 2008 4:04 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 2167 Location: United Kingdom
|
Posted: Tue Apr 08, 2008 4:10 pm Post subject: |
|
|
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: |
$SQL = "insert into weathermap_maps (configfile,titlecache,active,imagefile,htmlfile,filehash,config) VALUES ('$file','$title','on','','','','')";
|
Hopefully that will stop the error for you. |
|
| Back to top |
|
 |
cecfos
Joined: 08 Apr 2008 Posts: 5
|
Posted: Fri Apr 11, 2008 3:32 am Post subject: |
|
|
Hi
I just made the test and it seems to be ok.
i wish it was the solution.
thanks a lot. |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|