Install weathermap plugin on cacti 0.8.8a
Moderators: Developers, Moderators
Install weathermap plugin on cacti 0.8.8a
Hello,
I am currently trying to install weathermap version 0.97a on my cacti 0.8.8a.
I deployed the weathermap folder in plugins/ directory.
On the cacti interface I go to Plugin Management => click on action to ative the plugin.
Weathermap appears in the top front bar.
When I go in management => weathermap => Add => select simple.conf nothing happens.
Following a post on the forum (http://forums.cacti.net/viewtopic.php?f=16&t=47347) I changed the setup.php from TYPE to ENGINE.
But the tables are still not created.
I don't see any logs about issue (I activated the debug log level in cacti).
Any idea ?
Regards
I am currently trying to install weathermap version 0.97a on my cacti 0.8.8a.
I deployed the weathermap folder in plugins/ directory.
On the cacti interface I go to Plugin Management => click on action to ative the plugin.
Weathermap appears in the top front bar.
When I go in management => weathermap => Add => select simple.conf nothing happens.
Following a post on the forum (http://forums.cacti.net/viewtopic.php?f=16&t=47347) I changed the setup.php from TYPE to ENGINE.
But the tables are still not created.
I don't see any logs about issue (I activated the debug log level in cacti).
Any idea ?
Regards
Re: Install weathermap plugin on cacti 0.8.8a
Ok I found the solution :
In order to found the source of the issue, I had to comment out the test :
without that I was always skipping database setup (not sure to know why).
after that i found in the log file :
When I comment this line database setup is working (I tried with ENGINE=MyIsam).
This error make sens as the tables doesn't exist at this time right ?
Hope this help.
In order to found the source of the issue, I had to comment out the test :
Code: Select all
254 // only bother with all this if it's a new install, a new version, or we're in a development version
255 // - saves a handful of db hits per request!
256 //if( ($dbversion=="") || (preg_match("/dev$/",$myversion)) || ($dbversion != $myversion) )
after that i found in the log file :
Code: Select all
CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"update weathermap_maps set sortorder=id where sortorder is null;'
This error make sens as the tables doesn't exist at this time right ?
Hope this help.
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Install weathermap plugin on cacti 0.8.8a
Yes - the version check assumes that the previous create table commands worked...
0.97b fixes the original problem (TYPE vs ENGINE) - hopefully out this week. I've got the week off work, and it's my 'job' this week.
0.97b fixes the original problem (TYPE vs ENGINE) - hopefully out this week. I've got the week off work, and it's my 'job' this week.
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!)
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!)
Re: Install weathermap plugin on cacti 0.8.8a
I read weathermap 0.97(org,a,b,c) source code.
1) $dbversion is alway 0.97X(abc),this value is made by plugin.php
2) preg_match("/dev$/",$myversion), it make no sense for normal user.
3) $dbversion != $myversion is nerver true,because 1)
SQL "CREATE table XXXXXX..." world never work。
Code: Select all
function weathermap_setup_table () {
if( ($dbversion=="") || (preg_match("/dev$/",$myversion)) || ($dbversion != $myversion) )
{
2) preg_match("/dev$/",$myversion), it make no sense for normal user.
3) $dbversion != $myversion is nerver true,because 1)
SQL "CREATE table XXXXXX..." world never work。
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Install weathermap plugin on cacti 0.8.8a
If dbversion is 0.97a and myversion is 0.97c, then 3 is true. This is the intended logic. In other words, you have a version installed, and you have updated, so there are database modifications.icethink wrote:I read weathermap 0.97(org,a,b,c) source code.
1) $dbversion is alway 0.97X(abc),this value is made by plugin.phpCode: Select all
function weathermap_setup_table () { if( ($dbversion=="") || (preg_match("/dev$/",$myversion)) || ($dbversion != $myversion) ) {
2) preg_match("/dev$/",$myversion), it make no sense for normal user.
3) $dbversion != $myversion is nerver true,because 1)
SQL "CREATE table XXXXXX..." world never work。
dbversion is NOT set by plugin architecture:
Code: Select all
$dbversion = read_config_option("weathermap_db_version");
#1 is for new installs (nothing in the database yet) dbversion is set during this function, so initially it is blank.
#2 is for me, so that dev versions always do a full check for database tables.
#3 is for upgrades (different version in DB than in running code)
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!)
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!)
Re: Install weathermap plugin on cacti 0.8.8a
Thank you for your relay.
Yes ,you are right.I have a mistake in 1)
And I have a solution like this
in install function
but I have another problem.
SQL='CREATE TABLE ........) type=Myisam;'
synax error
SQL='CREATE TABLE ........) engine=Myisam;'
It works!
but MySQL official manual said both key wordtype and engine works.
I run sql on MySQL 5.3
Yes ,you are right.I have a mistake in 1)
And I have a solution like this
Code: Select all
weathermap_setup_table($iscreate=false){
...
if( ($dbversion=="") || (preg_match("/dev$/",$myversion)) || ($dbversion != $myversion) || $iscreate){
...
}
..
Code: Select all
regist_hook
regist_hook
regist_hook
weathermap_setup_table([color=#FF0000]true[/color]);
SQL='CREATE TABLE ........) type=Myisam;'
synax error
SQL='CREATE TABLE ........) engine=Myisam;'
It works!
but MySQL official manual said both key wordtype and engine works.
I run sql on MySQL 5.3
- Howie
- Cacti Guru User
- Posts: 5508
- Joined: Thu Sep 16, 2004 5:53 am
- Location: United Kingdom
- Contact:
Re: Install weathermap plugin on cacti 0.8.8a
I don't understand what your solution is the solution to.
The mysql type vs engine: I think it depends if you have strict mode enabled in mysql. At some point about a year ago I started getting lots of reports like this about tables not being created.
The mysql type vs engine: I think it depends if you have strict mode enabled in mysql. At some point about a year ago I started getting lots of reports like this about tables not being 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!)
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!)
Who is online
Users browsing this forum: No registered users and 29 guests