cacti拓扑
安装需求
lamp环境
net-snmp
rrdtool
cacti-0.8.8b.tar.gz
cacti环境搭建之lamp
[[email protected] ~]# yum -y install httpd mysql mysql-server mysql-php mysql-devel php php-mysql [[email protected] ~]# cat /var/www/html/index.php <?php phpinfo(); ?> [[email protected] ~]# /etc/init.d/httpd start 正在启动 httpd: [确定] [[email protected] ~]# /etc/init.d/mysqld start 正在启动 mysqld: [确定] [[email protected] ~]#
访问测试php是否完成
安装信息采集
[[email protected] ~]# yum -y install net-snmp net-snmp-utils net-snmp-devel [[email protected] ~]# /etc/init.d/snmpd start 正在启动 snmpd: [确定] [[email protected] ~]# chkconfig snmpd on
安装绘图工具
[[email protected] ~]# yum -y install rrdtool
安装cacti,设置连接数据库
[[email protected] ~]# tar zxf cacti-0.8.8b.tar.gz [[email protected] ~]# mv cacti-0.8.8b/ /var/www/html/cacti/ [[email protected] ~]# mysqlWelcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 19Server version: 5.1.73 Source distributionCopyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. mysql> create database cactidb; mysql> grant all on cactidb.* to ‘cactiuser‘@‘127.0.0.1‘ identified by ‘123123‘; mysql> quit [[email protected] ~]# cd /var/www/html/cacti/ [[email protected] cacti]# mysql cactidb< cacti.sql [[email protected] cacti]# vim include/config.php <?php /* +-------------------------------------------------------------------------+ | Copyright (C) 2004-2013 The Cacti Group | | | | This program is free software; you can redistribute it and/or | | modify it under the terms of the GNU General Public License | | as published by the Free Software Foundation; either version 2 | | of the License, or (at your option) any later version. | | | | This program is distributed in the hope that it will be useful, | | but WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | GNU General Public License for more details. | +-------------------------------------------------------------------------+ | Cacti: The Complete RRDTool-based Graphing Solution | +-------------------------------------------------------------------------+ | This code is designed, written, and maintained by the Cacti Group. See | | about.php and/or the AUTHORS file for specific developer information. | +-------------------------------------------------------------------------+ | http://www.cacti.net/ | +-------------------------------------------------------------------------+ */ /* make sure these values refect your actual database/host/user/password */ $database_type = "mysql"; $database_default = "cactidb"; $database_hostname = "127.0.0.1"; $database_username = "cactiuser"; $database_password = "123123"; $database_port = "3306"; $database_ssl = false; /* Edit this to point to the default URL of your Cacti install ex: if your cacti install as at http://serverip/cacti/ this would be set to /cacti/ */ $url_path = "/"; /* Default session name - Session name must contain alpha characters */ //$cacti_session_name = "Cacti"; ?>
cacti的初始化安装
[[email protected] ~]# vim /etc/httpd/conf/httpd.conf ocumentRoot "/var/www/html/cacti" <Directory "/var/www/html/cacti"> Options None AllowOverride None Order allow,deny Allow from all </Directory> [[email protected] ~]# /etc/init.d/httpd restart 停止 httpd: [确定] 正在启动 httpd: [确定] [[email protected] ~]#
访问安装
cacti默认登陆
admin 用户
admin 密码
需要修改
登陆界面
通过命令采集本机信息
[[email protected] cacti]# php /var/www/html/cacti/poller.php --force
里面的操作随便点也能懂。
时间: 2024-10-11 21:50:04