cacti 安装部署
1 cacti的官网 cacti.netcactifans.org cactifans中文版本系统监控软件要在apache上发布
Yum install httpd-y
要支持mysqlphp
yuminstall httpd php php-mysql mysqlmysql-server php-snmp net-snmp-utils –y
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/httpdstart
Cd /var/www/html/
Vi index.php
<?php
Phpinfo()
?>
Yum -y install rrdtool-*
Tarzxfcacti-0.8.8b.tar.gz -C /var/www/html/
Cd/var/www/html/
Mv cacti-0.8.8b/ cacti
ln -scacti-0.8.8b/ cacti
/etc/init.d/mysqld start
Mysql进入mysql
/etc/init.d/snmpd start
Netstat -antple它监听的是199端口
Snmpwalk -v1 –cpublic localhost IP-MIB::ipAdEntIfIndex
Rpm -qa|grep snmp
Vi /etc/snmp/snmpd.conf更改如下:
Com2seclocal localhost public
Com2sec mynetgroup 192.168.0.0/24 public
GroupMyRWGroup v1 local
Group MyRWGroup v2c local
Group MyRWGroupusm 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 allnonenone
Access MyRWGroup “” any noauth exact allnonenone
去掉disk /10000 的注解
/etc/init.d/snmpd restart
snmpd -f –Le(查看配置是否正确)
Snmpwalk-v1 –cpublic localhostIP-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/
Useraddcacti
Mysqladmin -pwestoscreate database cacti创建数据库
Mysql cacti < cacti.sql 导入数据
Mysql 进入mysql
Grantall oncacti.*to cacti@localhost identifiedby‘cacti’;
Flushprivileges;
Cd include
Viconfig.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 cacticacti-0.8.8b/ -R
Ll
Su-cacti
Crontab -e
*/5 ** * * php /var/www/html/cacti/poller.php >/dev/null2>&1
Crontab-l
在浏览器中输入ip/cacti/install/ 安装cacti
在浏览器中输入ip/cacti 打开cacti主页
登录名admin
密码:admin第一次登陆强制更改密码
Tarzxf 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 -qmysql-devel
Yuminstall mysql-devel -y
Yum install-ymake gcc
./configure 进行配置
Make
Cd /usr/local/spine/
Ls
Docs.cacti.net/wiki:documentation 下单击0.8.8Manual 然后单击(optional) installandconfigure spine查看怎么样配置和安装
需要安装net-snmp-develmysql-developenssl-devel do2unixautoconfautomake binutilslibtool gcc cppglibc-headerskernel-headers
Glibc-devel 软件包
yum install net-snmp-devel mysql-developenssl-devel dos2unix autoconf automake binutils libtool gcc cpp glibc-headerskernel-headers glibc-devel -y
然后
Shbootstrap
./configure
Make
Make install
Cd /usr/local/spine/etc/
Cpspine.conf.distspine.conf
Vimspine.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
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 -v1 -cpublic localhost IP-MIB::ipAdEntIfIndex
Snmpwalk -v1 –cpublic 192.168.0.251 IP-MIB::ipAdEntIfIndex
Snmpwalk -v1loclahost-c public.1.3.6.1.4.1.2021.9
Snmpwalk -v1 –cpublic192.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的插件
Tarzxfsettings-v0.71-1.tgz -C /var/www/html/cacti/plugins
Tarzxfmonitor-v1.3-1.tgz-C /var/www/html/cacti/plugins
Tar zxfthold-v0.4.9-3.tgz-C /var/www/html/cacti/plugins
Cd /var/www/html/cacti/plugins/
在web界面安装启动插件。
页:
[1]