监控软件cacti之安装

1.安装系统依赖包和搭建LAMP环境

[root@tong2 ~]# yum install rrdtool net-snmp net-snmp-libs net-snmp-utils -y

[root@tong2 ~]# yum install httpd php php-mysql php-snmp php-xml php-gd mysql-server mysql -y

[root@tong2 ~]# vim /etc/httpd/conf/httpd.conf

ServerName localhost

DirectoryIndex index.php index.html index.html.var

AddType application/x-httpd-php .php

[root@tong2 ~]# /etc/init.d/httpd restart
Stopping httpd:         [  OK  ]
Starting httpd:         [  OK  ]

[root@tong2 ~]# vim /var/www/html/index.php

<?php

phpinfo();

?>

[root@tong2 ~]#

测试:

wKioL1Ucq8vwPKXzAASBx88kjfc343.jpg

 

2.安装cacti监控软件

[root@tong2 ~]# wget http://www.cacti.net/downloads/cacti-0.8.8c.tar.gz

[root@tong2 ~]# tar xvf cacti-0.8.8c.tar.gz

[root@tong2 ~]# mv cacti-0.8.8c /var/www/html/cacti

[root@tong2 ~]# cd /var/www/html

[root@tong2 html]# chown -R apache:apache cacti/

[root@tong2 html]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.21-log MySQL Community Server (GPL)

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> grant all privileges on cacti.* to cacti@'localhost' identified by 'system';
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;

mysql> create database cacti;

mysql> \u cacti

mysql> source /var/www/html/cacti/cacti.sql ;

mysql> exit
Bye 
[root@tong2 html]# vim cacti/include/config.php

$database_type = "mysql";                    
$database_default = "cacti";                      --指定数据库

$database_hostname = "localhost";            --数据库服务器主机
$database_username = "cacti";                  --用户名
$database_password = "system";              --密码
$database_port = "3306";                          --端口
$database_ssl = false;

[root@tong2 html]# crontab  -e     --rrdtool绘图

*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php >/dev/null 2>&1

[root@tong2 html]# /etc/init.d/crond restart
Stopping crond:        [  OK  ]
Starting crond:         [  OK  ]
[root@tong2 html]# /etc/init.d/httpd restart
Stopping httpd:            [  OK  ]
Starting httpd:           [  OK  ]
[root@tong2 html]#

 

3.测试

wKioL1UcsaPzeiOjAAUiT4i3SoY733.jpg

wKiom1UcsGXy3aDYAAKm8GNBbDY187.jpg

wKioL1UcsaTjiSzjAAMt9sUqBj0797.jpg

初使密码:admin

wKioL1UcsaSDOaMeAAI-cYVEYVk810.jpg

修改密码:system

wKiom1UcsGbQRRPcAAJQoyjMVDs842.jpg

wKioL1UcsaXx8gCkAAOo7Ve-Nj0160.jpg

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值