Database monitoring system Lepus (Lepus)

Lepus

First, it Lepus this database monitoring system really has not been updated a long time! ! ! Last update time to stay in the
2016-05-03 day later again I found this database monitoring system is still very easy to use! ! !
Official website address: http://www.lepus.cc/
Description: Lepus can malfunction or potential performance problems when the database, according to user settings will be extremely timely alarm database.
The problem can be solved: to help enterprises solve the problem of database performance monitoring, performance bottlenecks found even avoid economic losses caused by the database of potential problems.
Business leaders to help decision-makers better operation and maintenance of the overall database capacity resources, reduce hardware costs. DBA operation and maintenance personnel to help enterprises solve repetitive and boring work to improve the operation and maintenance staff productivity and slow query push AWR performance reports, reduce communication costs and operation and maintenance personnel database developers.
You can see Lepus monitoring database system or find many are basically the current mainstream database system Mysql, Oracle, Mongodb, Redis ... data monitoring.

Here Insert Picture Description

So I wrote the following about the process of building concrete Lepus
core package requires the following:The rest can go to talk about Mysql official website View

The following packages need only be deployed to monitor the machine. Monitored machine without having to deploy.

1.MySQL5.1 and above (to be used to store data collected by the monitoring system)

2.Apache 2.2 and above (must, WEB server running server)

3.PHP 5.3 above (must provide support WEB interface does not support PHP7)

4.Python2 (must recommend version 2.6 and above, perform data acquisition and alarm tasks, does not support Python3)

5.Python monitoring database connections and associated drive module package These addresses are not used should be copied to the Thunder download

MySQLdb for python (Python MySQl connection interface for monitoring MySQL, this module must be installed)

下载地址:wget http://cdn.lepus.cc/cdncache/software/MySQLdb-python.zip

cx_oracle for python (Python Oracle connection interface, not necessarily, need to be monitored if this oracle modules must be installed)

下载地址: Oracle的地址比较复杂 根据官方文档来 
http://www.dbarun.com/docs/lepus/install/python-module/#toc-4

Pymongo for python (Python interface MongoDB, the non-essential, if desired MongoDB monitoring module must be installed)

下载地址:wget http://cdn.lepus.cc/cdncache/software/pymongo-2.7.tar.gz 

redis-py for python (Python Redis connection interface, not necessarily, if necessary Redis monitoring module must be installed)

下载地址:wget http://cdn.lepus.cc/cdncache/software/redis-py-2.10.3.tar.gz

Then we began to talk about the monitoring system set up Lepus

Prepare the environment to install depend graphical environment I was probably about 67+ dependencies

yum -y install httpd php php-mysql mariadb unzip
yum -y install epel-release mariadb-devel mariadb-server python2-pip.noarch python-devel lrzsz
# 我装lrzsz这个完全是考虑到有的同志是shell界面 用这个可以拖拽软件包

When you drag the finished package to view the directory should have these two files
Here Insert Picture Description
start extracting package

 unzip Lepus数据库企业监控系统3.8\ Beta版本官方下载.zip 
 unzip MySQL-python.zip 

Decompression performed to obtain the following two directories
Here Insert Picture Description
to edit our PythonMysql module

cd MySQLdb1-master/
vim site.cfg 

When you see this line content when you determine your configuration file mysql_config Where positions


We can use the which command to see my position in the / usr / bin / mysql_config
Here Insert Picture Description
Then you put him into / usr / bin / mysql_config Then save and exit
Here Insert Picture Description
then perform module installation steps

python setup.py build 
python setup.py install 

Here Insert Picture Description
This phase is currently encounter two error
The first: urllib2.HTTPError: HTTP Error 403: SSL is required
analysis of reasons: 1. Your Python dependencies is not installed complete virtual machine 2. You did not web! ! !
Solution:yum -y install python2-pip.noarch python-devel
Here Insert Picture Description
The second: error: command 'gcc' failed with exit status 1
analyze the reasons: gcc environment is not installed
Solution: yum -y install gcc gcc-c ++
Here Insert Picture Description
and then build on it it
Here Insert Picture Description
can occur following the installation time
Processing dependencies for MySQL-python1.2.4
Finished processing dependencies for MySQL-python
1.2.4
Here Insert Picture Description
into the main directory of our Lepus

 cd Lepus_v3.8_beta/python/
 python test_driver_mysql.py  # 检查连接驱动是否安装

If after the execution occurs MySQL python drivier is ok! Will be able to
Here Insert Picture Description
create a database and authorization of Lepus

systemctl start mariadb
mysqladmin -u root password
mysql -u root -p 
CREATE DATABASE lepus; #创建一个库
GRANT ALL ON lepus.* TO 'lepus'@'localhost' IDENTIFiED BY '123.com';#对库进行授权
flush privileges; # 刷新数据库权限

Lepus import database

cd ../sql/
mysql -u root -p123.com lepus < lepus_table.sql 
mysql -u root -p123.com lepus < lepus_data.sql 

Installation Lepus

cd Lepus_v3.8_beta/python/
chmod +x install.sh 
./install.sh 
cd ../php/
cp -a . /var/www/html/

Here Insert Picture Description
Editing connection to the database user and password

vim /usr/local/lepus/etc/config.ini 
user="lepus"
passwd="123.com"
dbname="lepus"

Here Insert Picture Description
PHP database file editing

vim /var/www/html/application/config/database.php 
$db['default']['username'] = 'lepus';
$db['default']['password'] = '123.com';

Here Insert Picture Description

We have not encountered this problem
Here Insert Picture Description

Published 15 original articles · won praise 22 · views 2849

Guess you like

Origin blog.csdn.net/Mint_Alone/article/details/103153526