Can´t add any maps to weathermap

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

big-timmy
Posts: 8
Joined: Thu Apr 03, 2008 9:47 am

Can´t add any maps to weathermap

Post by big-timmy »

Hi @ all,

I have installed weathermap 0.95 on cacti 0.87b on Windows Server 2003 running Apache 2.2.

Seems that the poller cannot create the needed sql tables in mysql.

Here is the cacti logfile output:

04/05/2008 04:24:53 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"update weathermap_maps set sortorder=id where sortorder is null or sortorder=0;'
04/05/2008 04:24:53 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update weathermap_maps set sortorder=id where sortorder is null or sortorder=0;"
04/05/2008 04:24:53 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"update weathermap_maps set filehash=LEFT(MD5(concat(id,configfile,rand())),20) where filehash = '';'
04/05/2008 04:24:53 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update weathermap_maps set filehash=LEFT(MD5(concat(id,configfile,rand())),20) where filehash = '';"
04/05/2008 04:24:53 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1101', 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 default 'on', configfile text NOT NULL, imagefile text NOT NULL, htmlfile text NOT NULL, titlecache text NOT NULL, filehash varchar (40) NOT NULL default '', warncount int(11) NOT NULL default 0, config text NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM;'
04/05/2008 04:24:53 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "CREATE TABLE weathermap_maps ( id int(11) NOT NULL auto_increment, sortorder int(11) NOT NULL default 0, active set('on','off') NOT NULL default 'on', configfile text NOT NULL, imagefile text NOT NULL, htmlfile text NOT NULL, titlecache text NOT NULL, filehash varchar (40) NOT NULL default '', warncount int(11) NOT NULL default 0, config text NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM;"
04/05/2008 04:24:53 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"update weathermap_maps set sortorder=id where sortorder is null;'


Can anyone halp me to fix the problem?

ArchitecturePlugin is installed and I successfully run the check.php from weathermap via browser and command line.

Many thanks in advance.

Tim
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Well, *does* your cacti database user have permission to create tables? :-)

check.php doesn't check anything to do with the database, only that various php functions exist.
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!)
big-timmy
Posts: 8
Joined: Thu Apr 03, 2008 9:47 am

Post by big-timmy »

Hi Howie,

I have followed the cacti installation guide step by step and one step was
"GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'mapasswd'".

I think, the cactiuser has the right to create tables then.

I tried to create the table by myself and got the error that the config is not allowed to have an default value. I edited the command and removed the value for config and then I was able to create the table.

After that I still wasn´t able to add a network weathermap.

Any other tipps so far??

Thanks.

Tim
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

big-timmy wrote:I tried to create the table by myself and got the error that the config is not allowed to have an default value.
Aaah. I think this is a different view of a bug that was fixed between 0.95 and 0.95b... I just noticed that you said 0.95 up there too. Please update to 0.95b and retry.
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!)
big-timmy
Posts: 8
Joined: Thu Apr 03, 2008 9:47 am

Post by big-timmy »

Again HI! :D

Sorry for my wrong information I gave........I have already installed version 0.95b. :roll:
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

:-(

Which version of mysql do you use? I will try and recreate the problem here - it's obviously not fixed after all...

(and do you use any special settings for mysql? strict mode for example?)
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!)
big-timmy
Posts: 8
Joined: Thu Apr 03, 2008 9:47 am

Post by big-timmy »

HI!

I´m not in the office right now, but I am very sure I user mysql v5.0.

I do not use any special settings. Everything is installed with default settings.

Here is the version, I use:
mysql-5.0.51a-win32
aflower
Posts: 9
Joined: Mon Apr 28, 2008 4:24 am

Post by aflower »

I have the same problem, can't add Weathermaps. No error message, it just returns to the Management -> Weathermaps view.

The Cacti log has the following message:

04/28/2008 11:22:30 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"update weathermap_maps set sortorder=id where sortorder is null or sortorder=0;'
04/28/2008 11:22:30 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"update weathermap_maps set filehash=LEFT(MD5(concat(id,configfile,rand())),20) where filehash = '';'
04/28/2008 11:22:30 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1101', 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 default 'on', configfile text NOT NULL, imagefile text NOT NULL, htmlfile text NOT NULL, titlecache text NOT NULL, filehash varchar (40) NOT NULL default '', warncount int(11) NOT NULL default 0, config text NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM;'
04/28/2008 11:22:30 AM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"update weathermap_maps set sortorder=id where sortorder is null;'


Weathermap 0.95b
Cacti 0.8.7b
Cacti Plugin Architecture 2.1
MySQL 5.0.51b
php 5.2.5
IIS 6.0
Windows 2003 SP2
aflower
Posts: 9
Joined: Mon Apr 28, 2008 4:24 am

Post by aflower »

I just installed Weathermaps version 0.941 instead, works like a charm. Guess I'll have to wait for 0.96 for this to be fixed then :-)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

aflower wrote:I just installed Weathermaps version 0.941 instead, works like a charm. Guess I'll have to wait for 0.96 for this to be fixed then :-)
Why do you think it will be fixed in 0.96?
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!)
aflower
Posts: 9
Joined: Mon Apr 28, 2008 4:24 am

Post by aflower »

I just thought so because it was supposed to have been fixed in 0.95b :)
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

aflower wrote:I just thought so because it was supposed to have been fixed in 0.95b :)
I can't recreate this problem, so currently, it isn't going to be fixed in 0.96. I have made a few changes which might help, but I don't get this issue on my windows mysql box.
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!)
aflower
Posts: 9
Joined: Mon Apr 28, 2008 4:24 am

Post by aflower »

Do you run the same version as me? (5.0.51b).

I have set up MySQL like this with the Configuration Wizard:

- Server Machine
- Non-Transactional Database Only
- Decision Support (DSS)/OLAP
- Enable TCP/IP Networking
- Enable Strict Mode
- Standard Character Set (latin1)
- Install as a Windows Service
- Include Bin Directory in Windows PATH
mullier_p
Posts: 2
Joined: Mon May 05, 2008 7:25 am

Post by mullier_p »

Hello,

I have the same problem on my new Cacti installation.
Here are the versions:
cacti: 0.8.7b
weathermaps: 0.95b
mysql: 5.0.51a

When I try to add a map, I have the following PHP error:

Code: Select all

Warning: Invalid argument supplied for foreach() in C:\Inetpub\wwwroot\cacti\plugins\weathermap\weathermap-cacti-plugin-mgmt.php on line 165

Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\wwwroot\cacti\plugins\weathermap\weathermap-cacti-plugin-mgmt.php:165) in C:\Inetpub\wwwroot\cacti\plugins\weathermap\weathermap-cacti-plugin-mgmt.php on line 105
When I lookuped up the cacti log fil I saw that the weathermap_maps table could not be created:

Code: Select all

05/05/2008 02:25:52 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1101', 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 default 'on', configfile text NOT NULL, imagefile text NOT NULL, htmlfile text NOT NULL, titlecache text NOT NULL, filehash varchar (40) NOT NULL default '', warncount int(11) NOT NULL default 0, config text NOT NULL default '', PRIMARY KEY (id) ) TYPE=MyISAM;' 
Then I edited setup.php, saw the "create table" statement and tried to create the table directly in mysql command line by doing a copy/paste of that block:

Code: Select all

mysql> CREATE TABLE weathermap_maps (
    ->                  id int(11) NOT NULL auto_increment,
    ->                  sortorder int(11) NOT NULL default 0,
    ->                  active set('on','off') NOT NULL default 'on',
    ->                  configfile text NOT NULL,
    ->                  imagefile text NOT NULL,
    ->                  htmlfile text NOT NULL,
    ->                  titlecache text NOT NULL,
    ->                  filehash varchar (40) NOT NULL default '',
    ->                  warncount int(11) NOT NULL default 0,
    ->                  config text NOT NULL default '',
    ->                  PRIMARY KEY  (id)
    ->          ) TYPE=MyISAM;
ERROR 1101 (42000): BLOB/TEXT column 'config' can't have a default value
So I guess -> config text NOT NULL default '',
Should be -> config text NOT NULL,

I have tried it like that and the table was created.

Code: Select all

mysql> show columns from weathermap_maps
    -> ;
+------------+-----------------+------+-----+---------+----------------+
| Field      | Type            | Null | Key | Default | Extra          |
+------------+-----------------+------+-----+---------+----------------+
| id         | int(11)         | NO   | PRI | NULL    | auto_increment |
| sortorder  | int(11)         | NO   |     | 0       |                |
| active     | set('on','off') | NO   |     | on      |                |
| configfile | text            | NO   |     | NULL    |                |
| imagefile  | text            | NO   |     | NULL    |                |
| htmlfile   | text            | NO   |     | NULL    |                |
| titlecache | text            | NO   |     | NULL    |                |
| filehash   | varchar(40)     | NO   |     |         |                |
| warncount  | int(11)         | NO   |     | 0       |                |
| config     | text            | NO   |     | NULL    |                |
+------------+-----------------+------+-----+---------+----------------+
10 rows in set (0.00 sec)
But when I try to add a map, I have now the following error:

Code: Select all

mysql> insert into weathermap_maps (configfile,titlecache,active,imagefile,htmlf
ile) VALUES ('test','Network Overview\r','on','','');
ERROR 1364 (HY000): Field 'config' doesn't have a default value
mysql>
It seems the attribute "default" for the text datatype does not exist anymore in that version of mysql???

What should I do now to have it work?
Thanks, Pierre.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I think this must be something to do with strict mode, because I don't get this issue with 5.0.(something). I'll look into it some more at some stage. It only seems to be windows users, too, for some reason.
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!)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests