In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Experimental environment:
Physical host redhat7.0 kernel version 3.10.0-123.el7.x86_64
Virtual machine redhat 6.5 kernel version 2.6.32-431.el6.x86_64
server10.example.com 172.25.254.10
Required software package: cacti-0.8.8h.tar.gz
cacti-spine-0.8.8h.tar.gz
php-snmp-5.3.3-26.el6.x86_64.rpm
monitor-v1.3-1.tgz
1. About Cacti
cacti is a software realized by php language, its main function is to obtain data by snmp service, snmp variable data is obtained by reading mysql database, and then stored and updated data by rrdtool, when users need to view data, rrdtool generates charts and presents them to users.
rrdtool updates and stores data is to process rrd file,rrd file is a file with fixed size, the number of data it can store has been defined when it is created.
1. Snmp is used to collect data;
2. Rrdtool is used to store data and generate graphs;
3. Mysql is used to store variable data and invoke variable data with PHP programs.
2. Basic configuration of cacti
(1)[root@server10 mnt]# yum install httpd -y
[root@server10 mnt]# tar -zxf cacti-0.8.8h.tar.gz
[root@server10 mnt]# mv cacti-0.8.8h /var/www/html/cacti
(2)[root@server10 mnt]# yum install php php-mysql mysql-server -y
##Simple lnmp architecture
[root@server10 mnt]# yum install rrdtool -y
(3)[root@server10 mnt]# yum install php-snmp-5.3.3-26.el6.x86_64.rpm -y
##php-snmp version should be the same as php version
(4)configuration database
[root@server10 mnt]# /etc/init.d/mysqld start ##Open database
[root@server10 mnt]# mysql_secure_installation ##database security initialization, give a root password, followed by y
[root@server10 mnt]# mysql -uroot -p ##Check if the database is initialized correctly, the root password I gave is westos
[root@server10 mnt]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.1.71 Source distribution
Copyright (c) 2000, 2013, 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> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
+--------------------+
2 rows in set (0.00 sec)
mysql>
cd /var/www/html/cacti
mysqladmin -pwestos create cacti ##Create cacti database user
mysql -pwestos cacti
< cacti.sql ##将cacti.sql表导入cacti数据库 mysql -predhat -e "grant all on cacti.* to cacti@localhost identified by 'redhat';" ##将cacti数据库的所有内容的权限赋给本地用户cacti mysql -ucacti -predhat ##进入cacti数据库查看一下 《1》show databses; 《2》use cacti; 《3》show tatbls; (5)配置cacti的apache访问页 cd /var/www/html/cacti/include/ vim config.php 29 $database_username = "cacti"; 30 $database_password = "redhat"; 39 $url_path = "/cacti/"; 42 $cacti_session_name = "Cacti"; /etc/init.d/httpd restart ##重启apache 浏览器访问http://172.25.254.10/cacti/ ##注意虚拟机和物理机的时间要同步 (6)浏览器访问时有红色警告出现,那是因为cacti服从snmp协议,虚拟机上当然要有这个协议支持咯! (7)yum install net-snmp-utils -y ##安装snmp协议 useradd -u 1000 -M -d /var/www/html/cacti cacti ##/var/www/html/cacti里的文件的所属用户和用户组都是id(1000),这是因为用户不存在,我们需要建立一个id=1000用户,安全第一 su - cacti crontab -e ##编辑定时任务 */5 * * * * php /var/www/html/cacti/poller.php >/dev/null 2>&1
crontab -l ##View timed tasks
Browser Refresh View
(8)Login to the webpage, password admin, and then change the password
The basic installation is complete and the virtual machine host is now being monitored.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.