- 论坛徽章:
- 0
|
创建硬盘监测new graphs----edit this host ------add data query ---snmp-get mounted
partions
内存监控要选择ucd/net-Memory Usage
系统:redhat4.2
安装包
apache 系统安装(httpd-2.0.52-19)
mysql 系统安装
php 系统安装
rrdtool-1.0.50.tar.gz
http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool-1.0.x/rrdtool
-
1.0.50.tar.gz
cacti-0.8.6g.tar.gz
http://www.cacti.net/downloads/
net-snmp安装
disk2
net-snmp-5.3.1.tar.gz
net-snmp-libs-5.1.2-11.EL4.6.i386.rpm
disk4
net-snmp-utils-5.1.2-11.EL4.6.i386.rpm
############################安装设置################################
1、设置mysql
# mysql -u root -p123
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10 to server version: 4.0.23-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>; create database cactidb;
Query OK, 1 row affected (0.00 sec)
mysql>; grant all on cactidb.* to root;
Query OK, 0 rows affected (0.01 sec)
mysql>; grant all on cactidb.* to
[email=root@localhost]root@localhost[/email]
;
Query OK, 0 rows affected (0.01 sec)
mysql>; grant all on cactidb.* to cactiuser;
Query OK, 0 rows affected (0.00 sec)
mysql>; grant all on cactidb.* to
[email=cactiuser@localhost]cactiuser@localhost[/email]
;
Query OK, 0 rows affected (0.01 sec)
mysql>; set password for
[email=cactiuser@localhost=password('wdxccactipw']cactiuser@localhost=password('wdxccactipw'[/email]
);
Query OK, 0 rows affected (0.00 sec)
mysql>; exit
2、安装rrdtool
tar zxvf rrdtool-1.0.50.tar.gz
./configure
make&&make install
3、安装net-snmp
rpm -qa |grep net-snmp
net-snmp-5.1.2-11.EL4.6 disk2
net-snmp-libs-5.1.2-11.EL4.6 disk2
net-snmp-utils-5.1.2-11.EL4.6 disk4
修改snmpd.conf
vi /etc/snmp/snmpd.conf
1)、查找以下字段:
# sec.name source community
com2sec notConfigUser default public
将"comunity"字段改为你要设置的密码.比如"public".
将“default”改为你想哪台机器可以看到你的snmp信息,如10.10.10.10。
2)、查找以下字段:
#
#access notConfigGroup "" any noauth exact systemview none none
改为
access notConfigGroup "" any noauth exact all none none
3)、查找以下字段:
#view all included .1 80
将该行前面的"#"去掉.
保存关闭.
4)、运行/etc/init.d/snmpd start命令运行snmpd.
chkconfig --level 35 snmpd on
4.安装cacti
cp cacti-0.8.6g.tar.gz /var/www/html
tar xzvf cacti-0.8.6c.tar.gz
mv cacti-0.8.6g cacti
cd cacti
vi /var/www/html/cacti/include/config.php
$database_type = “mysql”;
$database_default = “cactidb”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
$database_password = “******”;
导入表:
/usr/local/mysql/bin/mysql –u root –p123 cactidb
chown –R cactiuser rra/ log/
在cactiuser用户加入
*/5 * * * * /www/php/bin/php /www/htdocs/cacti/poller.php >; /dev/null 2>;&1
注意:不要使用root用户运行上面的“poller.php”命令,否则请再次运行chown –R
cactiuser rra/ log/
5、页面设置:
在浏览器上输入:
http://IP/cacti
在这里我们要输入一些原始的信息:
NEXT -》
输入一些信息,如rrdtool、php、snmpwalk、snmpget的位置,使用ucd-snmp还是net-snmp等 -》
输入原始的用户和密码:admin/admin -》
更改admin用户的密码 -》
点击 Save
cacti操作
建立第一个测点:New Graphs --create new host --Description (名字)---Hostname(IP)
---host template 选择local linux machine
将此点加入到树形结构
先创建一个根 Graph Trees -----add
再在此根下生成点 Graph Trees --- Tree Items ---add ---- Tree Item Type 选择host
就可以了。
此时就可正常浏览了,如果有多个监控点,添加上去就可以了。
SNMP - Get Mounted Partitions
SNMP - Interface Statistics
补充插件安装:thold monitor
下载
http://cactiuser.org
在安装插件之前先安装cacti-plugin-arch.tar这个补订才可以。
解压后有一个文件目录和patch文件,可以用patch文件,也可以将目录直接复制过去
[root@test tmp]# cd cacti-plugin-arch
cp files-0.8.6j/* /var/www/html/cacti/ -rf
vi /var/www/html/cacti/include/config.php
修改数据库 、用户密码。
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "11111111";
修改$config['url_path'] = '/cacti/'; 表示用这样方法显示
http://host/cacti/
添加两行所要安装模块名字,在$plugins = array();下面添加
$plugins = array();
$plugins[] = 'thold';
$plugins[] = 'monitor';
之后保存退出。
解压monitor-0.7.tar.gz thold-0.3.2.tar.gz
cp monitor thold /var/www/html/cacti/plugins/
这样就可以了。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/11765/showart_1866916.html |
|