Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Can´t add any maps to weathermap
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
big-timmy



Joined: 03 Apr 2008
Posts: 8

PostPosted: Sat Apr 05, 2008 9:28 am    Post subject: Can´t add any maps to weathermap Reply with quote

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
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1966
Location: United Kingdom

PostPosted: Sat Apr 05, 2008 4:59 pm    Post subject: Reply with quote

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.
Back to top
big-timmy



Joined: 03 Apr 2008
Posts: 8

PostPosted: Sun Apr 06, 2008 10:03 am    Post subject: Reply with quote

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
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1966
Location: United Kingdom

PostPosted: Sun Apr 06, 2008 10:05 am    Post subject: Reply with quote

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.
Back to top
big-timmy



Joined: 03 Apr 2008
Posts: 8

PostPosted: Sun Apr 06, 2008 10:27 am    Post subject: Reply with quote

Again HI!

Sorry for my wrong information I gave........I have already installed version 0.95b.
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1966
Location: United Kingdom

PostPosted: Sun Apr 06, 2008 10:45 am    Post subject: Reply with quote



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?)
Back to top
big-timmy



Joined: 03 Apr 2008
Posts: 8

PostPosted: Sun Apr 06, 2008 11:10 am    Post subject: Reply with quote

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
Back to top
aflower



Joined: 28 Apr 2008
Posts: 5

PostPosted: Mon Apr 28, 2008 4:27 am    Post subject: Reply with quote

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
Back to top
aflower



Joined: 28 Apr 2008
Posts: 5

PostPosted: Mon Apr 28, 2008 9:11 am    Post subject: Reply with quote

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
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1966
Location: United Kingdom

PostPosted: Mon Apr 28, 2008 9:20 am    Post subject: Reply with quote

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?
Back to top
aflower



Joined: 28 Apr 2008
Posts: 5

PostPosted: Mon Apr 28, 2008 1:25 pm    Post subject: Reply with quote

I just thought so because it was supposed to have been fixed in 0.95b
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1966
Location: United Kingdom

PostPosted: Mon Apr 28, 2008 2:26 pm    Post subject: Reply with quote

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.
Back to top
aflower



Joined: 28 Apr 2008
Posts: 5

PostPosted: Tue Apr 29, 2008 2:48 am    Post subject: Reply with quote

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
Back to top
mullier_p



Joined: 05 May 2008
Posts: 2

PostPosted: Mon May 05, 2008 8:12 am    Post subject: Reply with quote

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:

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:

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:

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:

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:

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.
Back to top
Howie
Cacti Guru User


Joined: 16 Sep 2004
Posts: 1966
Location: United Kingdom

PostPosted: Mon May 05, 2008 9:08 am    Post subject: Reply with quote

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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 



Powered by phpBB © 2001, 2005 phpBB Group