2012年(30)
分类:
2012-04-21 19:53:58
原文地址:cacti优化 作者:ning_lianjie
创建索引
CREATE INDEX `data_template_data_id` ON `data_input_data` (`data_template_data_id`);
CREATE INDEX `host_id_snmp_query_id_snmp_index` ON data_local (`host_id`,`snmp_query_id`,`snmp_index`);
CREATE INDEX `local_data_id_data_source_name` ON data_template_rrd (`local_data_id`,`data_source_name`);
CREATE INDEX `graph_template_id_local_graph_id` ON graph_templates_item (`graph_template_id`,`local_graph_id`);
CREATE INDEX `local_graph_template_item_id` ON graph_templates_item (`local_graph_template_item_id`);
CREATE INDEX `host_id_snmp_query_id_snmp_index` ON host_snmp_cache (`host_id`,`snmp_query_id`,`snmp_index`);
CREATE INDEX `local_data_id_rrd_path` ON poller_item (`local_data_id`,`rrd_path`);
CREATE INDEX `host_id_rrd_next_step` ON poller_item (`host_id`,`rrd_next_step`);
CREATE INDEX host_id_snmp_query_id ON host_snmp_cache (host_id,snmp_query_id);
CREATE INDEX host_id_snmp_port ON poller_item (host_id,snmp_port);
CREATE INDEX data_source_path ON data_template_data (data_source_path);
使用spine替代默认的cmd.php来采集数据(参考spine的安装)
http://blog.chinaunix.net/space.php?uid=16844903&do=blog&id=308835
重构rra文件的目录结构
1·在crontab里禁用poller.php
2·然后执行cacti_install_dir/cli目录下的structure_rra_paths.php
/usr/bin/php structure_rra_paths.php --proceed
它会将所有的RRD文件按照device重新分配目录
3·修改数据库中的RRD路径
Settings—>Paths
4·恢复poller.php的crontab