Установка и настройка Weathermap

Страница загрузки www.network-weathermap.com/download
Скачивание wethermap, например:

wget http://www.network-weathermap.com/files/php-weathermap-0.97c.zip

Распаковка в директорию ../cacti/plugins/weathermap
Для включения редактор необходимо изменить $ENABLED=false; на $ENABLED=true; в файле ../cacti/plugins/weathermap/editor.php
Права файлов:

chown www-data ../cacti/plugins/weathermap/output
chown www-data ../cacti/plugins/weathermap/configs
chmod u+w ../cacti/plugins/weathermap/configs
chmod u+w ../cacti/plugins/weathermap/output

Необходимо изменить $mapdir в ../cacti/plugins/weathermap/editor-config.php
Необходимо открыть в браузере http://домен/cacti/plugins/weathermap/check.php и убедится все ли нормально.
Если необходимо, то установить дополнительную библиотеку:

sudo apt-get install php5-gd

Создание таблицы weathermap в базе cacti:

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_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) ) 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;

Дополнительные SQL для Weathermap:

DROP TABLE IF EXISTS `weathermap_data`;
DROP TABLE IF EXISTS `weathermap_settings`;
DROP TABLE IF EXISTS `weathermap_groups`;
DROP TABLE IF EXISTS `weathermap_auth`;
DROP TABLE IF EXISTS `weathermap_maps`;

DROP TABLE IF EXISTS `weathermap_data`;
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;

DROP TABLE IF EXISTS `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)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `weathermap_groups`;
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);

DROP TABLE IF EXISTS `weathermap_auth`;
CREATE TABLE weathermap_auth (
userid mediumint(9) NOT NULL default '0',
mapid int(11) NOT NULL default '0'
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `weathermap_maps`;
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,
config text NOT NULL,
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;

Официальная документация www.network-weathermap.com/manual/0.97b/pages/install-cacti-editor.html

Добавить комментарий