http://down.51cto.com/data/1877049(所有安装包和文档下载地址)
1 cacti的官网 cacti.net cactifans.org cactifans中文版本
系统监控软件要在apache上发布
Yum install httpd -y
要支持mysql php
yum install httpd php php-mysql mysqlmysql-server php-snmp net-snmp-utils �Cy
service mysqldstart
chkconfig mysqld on
service httpd start
chkconfig httpd on
下载软件包 php-snmp-5.3.3-22.el6.x86_64.rpm
Rpm -ivh php-snmp-5.3.3-22.el6.x86_64.rpm(自己安装有依赖关系)
/etc/init.d/crond status
Vi /etc/php.ini 如下:
Safe_mode = Off
Date.timezone = Asia/Shanghai
Cd /usr/share/zoneinfo/ 系统的支持时间
Cd /etc/php.d/
/etc/init.d/httpd start
Cd /var/www/html/
Vi index.php
<?php
Phpinfo()
?>
Yum -y install rrdtool-*
Tar zxf cacti-0.8.8b.tar.gz -C /var/www/html/
Cd /var/www/html/
Mv cacti-0.8.8b/ cacti
ln -s cacti-0.8.8b/ cacti
/etc/init.d/mysqld start
Mysql 进入mysql
/etc/init.d/snmpd start
Netstat -antple 它监听的是199端口
Snmpwalk -v 1 �Cc public localhost IP-MIB::ipAdEntIfIndex
Rpm -qa | grep snmp
Vi /etc/snmp/snmpd.conf更改如下:
Com2sec local localhost public
Com2sec mynetgroup 192.168.0.0/24 public
Group MyRWGroup v1 local
Group MyRWGroup v2c local
Group MyRWGroup usm local
Group MyROGroup v1 mynetwork
Group MyROGroup v2c mynetwork
Group MyROGroup usm mynetwork
View systemview included .1.3.6.1.2.1 去掉最后的.1
View systemview included .1.3.6.1.2.1.25.1.1
View all included .1 80
Access MyROGroup “” any noauth exact all none none
Access MyRWGroup “” any noauth exact all none none
去掉disk /10000 的注解
/etc/init.d/snmpd restart
snmpd -f �CLe(查看配置是否正确)
Snmpwalk -v 1 �Cc public localhost IP-MIB::ipAdEntIfIndex 就能看到信息了
IP-MIB::ipAdEntIfIndex.127.0.0.1 = INTEGER:1
IP-MIB::ipAdEntIfIndex.192.168.11.185 =INTEGER: 2
Cd /var/www/html/cacti/
Useradd cacti
Mysqladmin -pwestos create database cacti 创建数据库
Mysql cacti < cacti.sql 导入数据
Mysql 进入mysql
Grant all on cacti.* to cacti@localhost identified by ‘cacti’;
Flush privileges;
Cd include
Vi config.php更改如下:
Database_type = “mysql” ;
Database_default = “cacti” ;
Database_hostname = “localhost” ;
Database_username = “cacti” ;
Database_password = “cacti” ;
Database_port = “3306” ;
Database_ssl = false;
$url_path = “/cacti/” ;
$cacti_session_name = “cacti” ;
Cd /var/www/html/
Chown cacti cacti-0.8.8b/ -R
Ll
Su - cacti
Crontab -e
*/5 ** * * php /var/www/html/cacti/poller.php > /dev/null 2>&1
Crontab -l
在浏览器中输入 ip/cacti/install/ 安装cacti
在浏览器中输入 ip/cacti 打开cacti主页
登录名admin
密码:admin 第一次登陆强制更改密码
Tar zxf cacti-spine-0.8.8b.tar.gz
Cd cacti-spine-0.8.8b
Less INSTALL
./configure --help 查看配置的信息
Rpm -q net-snmp-devel 查看net-snmp-devel的版本
Rpm -q mysql-devel
Yum install mysql-devel -y
Yum install -y make gcc
./configure 进行配置
Make
Cd /usr/local/spine/
Ls
Docs.cacti.net/wiki:documentation 下单击0.8.8Manual 然后单击(optional) install and configure spine 查看怎么样配置和安装
需要安装net-snmp-devel mysql-devel openssl-devel do2unix autoconf automake binutils libtool gcc cppglibc-headers kernel-headers
Glibc-devel 软件包
yum install net-snmp-devel mysql-developenssl-devel dos2unix autoconf automake binutils libtool gcc cpp glibc-headerskernel-headers glibc-devel -y
然后
Sh bootstrap
./configure
Make
Make install
Cd /usr/local/spine/etc/
Cp spine.conf.dist spine.conf
Vim spine.conf更改如下:
DB_Host localhost #host
DB_Database cactidb #mysql database name
DB_User cacti #usename for mysql connect cacti
DB_Pass 123456 #passwd for cacti user
DB_Port 3306
DB_PreG 1
/usr/local/spine/bin/spine --help
/usr/local/spine/bin/spine 启动有错误
unable to read configuration file
因为/etc/下没有spine的配置文件
Mv /usr/local/spine/etc/spine.conf /etc/
/usr/local/spine/bin/spine 启动
SPINE: Using spine config file[/etc/spine.conf]
SPINE: Version 0.8.8b starting
SPINE: Time: 0.1018 s, Threads: 5, Hosts: 2
在浏览器输入ip/cacti/settings 进行设置
Vi /etc/snmp/snmp.conf
在另外一台主机上(servre1)
vim /etc/snmp/snmpd.conf 更改和上一台一样(去掉disk前的注解)
/etc/init.d/snmp.conf start 启动
在server96上
Snmpwalk -v 1 -c public localhost IP-MIB::ipAdEntIfIndex
Snmpwalk -v 1 �Cc public 192.168.0.251 IP-MIB::ipAdEntIfIndex
Snmpwalk -v 1loclahost -c public .1.3.6.1.4.1.2021.9
Snmpwalk -v1 �Cc public 192.168.0.251 .1.3.6.1.4.1.2021.9
在网页中添加一个host和给这个host创建图
下载thold-v0v4v9-3.tgz monitor-v1.3-1.tgz settings-v0.71-1.tgz cacti的插件
Tar zxf settings-v0.71-1.tgz -C /var/www/html/cacti/plugins
Tar zxf monitor-v1.3-1.tgz -C /var/www/html/cacti/plugins
Tar zxf thold-v0.4.9-3.tgz -C /var/www/html/cacti/plugins
Cd /var/www/html/cacti/plugins/
在web界面安装启动插件。