Cant add weathermap files to Cacti

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
angelusofkl
Posts: 10
Joined: Fri Jan 13, 2012 3:10 pm

Cant add weathermap files to Cacti

Post by angelusofkl »

Hi trying to use "add" to add the weathermap map through Cacti as a plug in and i get:
(the page just shows that 0 maps were added)

02/10/2012 11:10:09 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select * from weathermap_maps"
02/10/2012 11:10:07 AM - WEATHERMAP: Poller[0] STATS: Weathermap 0.97a run complete - Fri, 10 Feb 12 11:10:07 -0800: 0 maps were run in 0 seconds with 0 warnings.
02/10/2012 11:10:07 AM - WEATHERMAP: Poller[0] WARNING: No activated maps found. [WMPOLL05]
02/10/2012 11:10:07 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select m.*, g.name as groupname from weathermap_maps m,weathermap_groups g where m.group_id=g.id and active='on' order by sortorder,id"
02/10/2012 11:10:07 AM - WEATHERMAP: Poller[0] Weathermap 0.97a starting - Normal logging mode. Turn on DEBUG in Cacti for more information
02/10/2012 11:10:07 AM - SYSTEM STATS: Time:6.2959 Method:cmd.php Processes:4 Threads:N/A Hosts:13 HostsPerProcess:4 DataSources:28 RRDsProcessed:13
02/10/2012 11:10:07 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select distinct weathermap_data.id, weathermap_data.last_value, weathermap_data.last_time, weathermap_data.data_source_name, data_template_data.data_source_path, data_template_data.local_data_id, data_template_rrd.data_source_type_id from weathermap_data, data_template_data, data_template_rrd where weathermap_data.local_data_id=data_template_data.local_data_id and data_template_rrd.local_data_id=data_template_data.local_data_id and weathermap_data.local_data_id<>0;"
02/10/2012 11:10:07 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select distinct weathermap_data.id, weathermap_data.last_value, weathermap_data.last_time, weathermap_data.data_source_name, data_template_data.data_source_path, data_template_data.local_data_id, data_template_rrd.data_source_type_id from weathermap_data, data_template_data, data_template_rrd where weathermap_data.local_data_id=data_template_data.local_data_id and data_template_rrd.local_data_id=data_template_data.local_data_id and weathermap_data.local_data_id<>0;"
02/10/2012 11:10:07 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select distinct weathermap_data.id, weathermap_data.last_value, weathermap_data.last_time, weathermap_data.data_source_name, data_template_data.data_source_path, data_template_data.local_data_id, data_template_rrd.data_source_type_id from weathermap_data, data_template_data, data_template_rrd where weathermap_data.local_data_id=data_template_data.local_data_id and data_template_rrd.local_data_id=data_template_data.local_data_id and weathermap_data.local_data_id<>0;"
02/10/2012 11:10:06 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select distinct weathermap_data.id, weathermap_data.last_value, weathermap_data.last_time, weathermap_data.data_source_name, data_template_data.data_source_path, data_template_data.local_data_id, data_template_rrd.data_source_type_id from weathermap_data, data_template_data, data_template_rrd where weathermap_data.local_data_id=data_template_data.local_data_id and data_template_rrd.local_data_id=data_template_data.local_data_id and weathermap_data.local_data_id<>0;"
02/10/2012 11:10:06 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select distinct weathermap_data.id, weathermap_data.last_value, weathermap_data.last_time, weathermap_data.data_source_name, data_template_data.data_source_path, data_template_data.local_data_id, data_template_rrd.data_source_type_id from weathermap_data, data_template_data, data_template_rrd where weathermap_data.local_data_id=data_template_data.local_data_id and data_template_rrd.local_data_id=data_template_data.local_data_id and weathermap_data.local_data_id<>0;"
02/10/2012 11:10:06 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select distinct weathermap_data.id, weathermap_data.last_value, weathermap_data.last_time, weathermap_data.data_source_name, data_template_data.data_source_path, data_template_data.local_data_id, data_template_rrd.data_source_type_id from weathermap_data, data_template_data, data_template_rrd where weathermap_data.local_data_id=data_template_data.local_data_id and data_template_rrd.local_data_id=data_template_data.local_data_id and weathermap_data.local_data_id<>0;"
02/10/2012 11:10:06 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select distinct weathermap_data.id, weathermap_data.last_value, weathermap_data.last_time, weathermap_data.data_source_name, data_template_data.data_source_path, data_template_data.local_data_id, data_template_rrd.data_source_type_id from weathermap_data, data_template_data, data_template_rrd where weathermap_data.local_data_id=data_template_data.local_data_id and data_template_rrd.local_data_id=data_template_data.local_data_id and weathermap_data.local_data_id<>0;"
02/10/2012 11:10:06 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select distinct weathermap_data.id, weathermap_data.last_value, weathermap_data.last_time, weathermap_data.data_source_name, data_template_data.data_source_path, data_template_data.local_data_id, data_template_rrd.data_source_type_id from weathermap_data, data_template_data, data_template_rrd where weathermap_data.local_data_id=data_template_data.local_data_id and data_template_rrd.local_data_id=data_template_data.local_data_id and weathermap_data.local_data_id<>0;"
02/10/2012 11:10:06 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select distinct weathermap_data.id, weathermap_data.last_value, weathermap_data.last_time, weathermap_data.data_source_name, data_template_data.data_source_path, data_template_data.local_data_id, data_template_rrd.data_source_type_id from weathermap_data, data_template_data, data_template_rrd where weathermap_data.local_data_id=data_template_data.local_data_id and data_template_rrd.local_data_id=data_template_data.local_data_id and weathermap_data.local_data_id<>0;"
02/10/2012 11:10:06 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select distinct weathermap_data.id, weathermap_data.last_value, weathermap_data.last_time, weathermap_data.data_source_name, data_template_data.data_source_path, data_template_data.local_data_id, data_template_rrd.data_source_type_id from weathermap_data, data_template_data, data_template_rrd where weathermap_data.local_data_id=data_template_data.local_data_id and data_template_rrd.local_data_id=data_template_data.local_data_id and weathermap_data.local_data_id<>0;"
02/10/2012 11:10:06 AM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"select distinct weathermap_data.id, weathermap_data.last_value, weathermap_data.last_time, weathermap_data.data_source_name, data_template_data.data_source_path, data_template_data.local_data_id, data_template_rrd.data_source_type_id from weathermap_data, data_template_data, data_template_rrd where weathermap_data.local_data_id=data_template_data.local_data_id and data_template_rrd.local_data_id=data_template_data.local_data_id and weathermap_data.local_data_id<>0;"
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Cant add weathermap files to Cacti

Post by Howie »

If you look in the Cacti technical support page, can you see the weathermap_maps, weathermap_data etc tables? I don't think they have been created.
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!)
angelusofkl
Posts: 10
Joined: Fri Jan 13, 2012 3:10 pm

Re: Cant add weathermap files to Cacti

Post by angelusofkl »

You are right,
how can i create them? ( something detailed and step by step as i am a newbie in SQL)
angelusofkl
Posts: 10
Joined: Fri Jan 13, 2012 3:10 pm

Re: Cant add weathermap files to Cacti

Post by angelusofkl »

it seems that none of my weathermaps are defined in sql...can anyone tell me how to define these settings ?
angelusofkl
Posts: 10
Joined: Fri Jan 13, 2012 3:10 pm

Re: Cant add weathermap files to Cacti

Post by angelusofkl »

from what i understand the tables for weathermap supposed to be auto-magicaly created , but i dont see them anywhere, and links onthe weathermap tag dont lead back to cacti options but show the full \plugin\weathermap\etc path. Can anyone tell me how to add the tables to the Cacti SQL?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Cant add weathermap files to Cacti

Post by Howie »

Save the following into weathermap.sql, and then import it into your Cacti database, the same as you did with the cacti.sql file originally. This is the table-creation commands that the automatic setup would normally create for you, but updated for latest MySQL versions...

Code: Select all

CREATE TABLE weathermap_maps (
				id int(11) NOT NULL auto_increment,
				sortorder int(11) NOT NULL default 0,
				group_id int(11) NOT NULL default 1,
				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,
                debug set('on','off','once') NOT NULL default 'off',
                runtime double NOT NULL default 0,
				lastrun datetime,
				config text NOT NULL default '',
				thumb_width int(11) NOT NULL default 0,
				thumb_height int(11) NOT NULL default 0,
				schedule varchar(32) NOT NULL default '*',
				archiving set('on','off') NOT NULL default 'off',
				PRIMARY KEY  (id)
			) ENGINE=MyISAM;
			
CREATE TABLE weathermap_auth (
							userid mediumint(9) NOT NULL default '0',
							mapid int(11) NOT NULL default '0'
						) ENGINE=MyISAM;
						
CREATE TABLE  weathermap_groups (
										`id` INT(11) NOT NULL auto_increment,
										`name` VARCHAR( 128 ) NOT NULL default '',
										`sortorder` INT(11) NOT NULL default 0,
										PRIMARY KEY (id)
										) ENGINE=MyISAM;
										
										
INSERT INTO weathermap_groups (id,name,sortorder) VALUES (1,'Weathermaps',1);

CREATE TABLE IF NOT EXISTS weathermap_data (id int(11) NOT NULL auto_increment,
				rrdfile varchar(255) NOT NULL,data_source_name varchar(19) NOT NULL,
				  last_time int(11) NOT NULL,last_value varchar(255) NOT NULL,
				last_calc varchar(255) NOT NULL, sequence int(11) NOT NULL, local_data_id int(11) NOT NULL DEFAULT 0, PRIMARY KEY  (id), KEY rrdfile (rrdfile),
				  KEY local_data_id (local_data_id), KEY data_source_name (data_source_name) ) ENGINE=MyISAM;


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!)
angelusofkl
Posts: 10
Joined: Fri Jan 13, 2012 3:10 pm

Re: Cant add weathermap files to Cacti

Post by angelusofkl »

tried to import it with command bellow from my shell, it killed mysql db completely
shell> mysql --user=root --password cacti < c:\weathermap.sql
->
->
FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'
is there anyway i i can pull it back up or i will need to recreate the whole DB again ?
User avatar
cacteyeCanada
Posts: 1
Joined: Thu May 03, 2012 10:04 am
Location: Canada

Re: Cant add weathermap files to Cacti

Post by cacteyeCanada »

I used Howie's weathermap.sql script above and I can confirm that it worked perfectly. Thanks!
pier62350
Posts: 15
Joined: Thu Aug 02, 2012 9:12 am

Re: Cant add weathermap files to Cacti

Post by pier62350 »

Hello all,

I've the same problem and I've try to use this script to create the tables in the cacti database. The import is OK but cacti send me errors with a database named "weathermap_settings" can somebody add the .sql file needed to create this table?
londi
Posts: 3
Joined: Fri Sep 07, 2012 5:57 am

Re: Cant add weathermap files to Cacti

Post by londi »

pier62350 wrote:Hello all,

I've the same problem and I've try to use this script to create the tables in the cacti database. The import is OK but cacti send me errors with a database named "weathermap_settings" can somebody add the .sql file needed to create this table?
I had this problem and above solution worked, but I had to add manually table from setup.php with weathermap_settings:

CREATE TABLE weathermap_settings (
id int(11) NOT NULL auto_increment,
mapid int(11) NOT NULL default '0',
groupid int(11) NOT NULL default '0',
optname varchar(128) NOT NULL default '',
optvalue varchar(128) NOT NULL default '',
PRIMARY KEY (id)
) TYPE=MyISAM;

Hope this helps!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests