CentOS7.2 install lepus database monitoring system

Lepus is an open source database monitoring platform. It currently supports basic monitoring and alarms of databases such as MySQL, Oracle, SQLServer, MongoDB, Redis (MySQL already supports replication monitoring, slow query analysis and Advanced functions such as directional push). Lepus does not need to deploy scripts or agents on each database server. It only needs to create an authorized account in the database to perform remote monitoring. It is suitable for monitoring companies with more database servers and monitoring databases in the cloud. This will greatly reduce monitoring deployment for enterprises. At the same time, the Lepus system has built-in rich performance monitoring indicators, so that companies can find potential performance problems and deal with them before the database goes down, reducing the company's direct losses due to database problems.

1、 Install lamp environment##

Environmental description
System version CentOS 7.2 x86_64
Software version lepus 3.7

[ root@lepus ~]# yum install -y httpd php php-mysql mariadb-server

2、 Install Python Basic Module##

2.1、 Install MySQLdb for python

[ root@lepus ~]# mkdir -p /service/tools
[ root@lepus ~]# cd /service/tools
[ root@lepus tools]# unzip MySQLdb-python.zip
[ root@lepus MySQLdb1-master]# cd MySQLdb1-master/[root@lepus MySQLdb1-master]# yum install -y mariadb-devel
[ root@lepus MySQLdb1-master]# which mysql_config
/usr/bin/mysql_config
[ root@lepus MySQLdb1-master]# vim site.cfg
mysql_config =/usr/bin/mysql_config
[ root@lepus MySQLdb1-master]# python setup.py build		#The following error occurred

[ root@lepus MySQLdb1-master]# yum install -y python2-pip	#Solve the error
[ root@lepus MySQLdb1-master]# python setup.py build		#The following error occurred

[ root@lepus MySQLdb1-master]# yum install -y python-devel 	#Solve the error
[ root@lepus MySQLdb1-master]# python setup.py build
[ root@lepus MySQLdb1-master]# python setup.py install

2.2、 Install cx_oracle for python (if you need to monitor Oracle, you must install it)

[ Download and install oracle instant client]
( http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html)

[ root@lepus tools]# rpm -ivh oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
[ root@lepus tools]# rpm -ivh oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
[ root@lepus tools]# rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm
[ root@lepus tools]# vim /root/.bash_profile
ORACLE_HOME="/usr/lib/oracle/11.2/client64"
PATH=$PATH:$ORACLE_HOME/bin
export PATH 
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH
[ root@lepus tools]# source ~/.bash_profile		#Reload bash after modification_profile file
[ root@lepus tools]# vim /etc/ld.so.conf
/usr/lib/oracle/11.2/client64/lib
[ root@lepus tools]# ldconfig		#Execute ldconfig to take effect
Install cx_oracle
[ root@lepus tools]# tar xf cx_Oracle-5.2.1.tar.gz 
[ root@lepus tools]# cd cx_Oracle-5.2.1/[root@lepus cx_Oracle-5.2.1]# python setup.py build
[ root@lepus cx_Oracle-5.2.1]# python setup.py install

2.3、 Install Pymongo for python (If you need to monitor Mongodb, you must install it)

[ root@lepus tools]# tar xf pymongo-2.7.tar.gz 
[ root@lepus tools]# cd pymongo-2.7/[root@lepus pymongo-2.7]# python setup.py install

2.4、 Install the Redis driver (if you need to monitor Redis, you must install it)

[ root@lepus tools]# tar xf redis-py-2.10.3.tar.gz 
[ root@lepus tools]# cd redis-2.10.3/[root@lepus redis-2.10.3]# python setup.py install

2.5、 Test whether each driver is running normally (not required)

In the python directory of the lepus installation file package, find the following test file to test whether the above driver is installed correctly

[ root@lepus tools]#Unzip Lepus database enterprise monitoring systemThree.7 version official download.zip
[ root@lepus tools]# cd lepus_v3.7/python/[root@lepus python]# python test_driver_mysql.py 
MySQL python drivier is ok![root@lepus python]# python test_driver_oracle.py 
Oracle python drivier is ok![root@lepus python]# python test_driver_mongodb.py 
MongoDB python drivier is ok![root@lepus python]# python test_driver_redis.py 
Redis python drivier is ok!

3、 Install Lepus Collector##

[ root@lepus sql]# systemctl start mariadb.service 		#Start service
[ root@lepus sql]# systemctl enable mariadb.service
[ root@lepus sql]# mysqladmin -uroot password '123456'	#Set database password
[ root@lepus sql]# mysql -uroot -p123456
MariaDB [(none)]> create database lepus default character set utf8;		#Create database
MariaDB [(none)]> grant all on lepus.* to lepus@localhost identified by '123456';		#Authorization
MariaDB [(none)]> exit
[ root@lepus sql]# mysql -ulepus -p123456 lepus <lepus_table.sql 		#Import database file
[ root@lepus sql]# mysql -ulepus -p123456 lepus <lepus_data.sql
[ root@lepus sql]# cd ../python/[root@lepus python]# chmod +x install.sh		#Add execute permission for installation script
[ root@lepus python]# ./install.sh				#installation
[ root@lepus python]# cd /usr/local/lepus/[root@lepus lepus]# vim etc/config.ini			#Modify the configuration file
[ monitor_server]
host="127.0.0.1"
port=3306
user="lepus"
passwd="123456"
dbname="lepus"[root@lepus lepus]# lepus start				#start up

4、 Install WEB Management Console##

[ root@lepus lepus]# cd /service/tools/lepus_v3.7/php/[root@lepus php]# cp -a ./var/www/html/			#Copy the web interface code
[ root@lepus php]# systemctl start httpd.service 		#Start service
[ root@lepus php]# systemctl enable httpd.service
[ root@lepus html]# vim application/config/database.php		#Modify the configuration file
$db['default']['hostname']='127.0.0.1';
$db['default']['port']='3306';
$db['default']['username']='lepus';
$db['default']['password']='123456';
$db['default']['database']='lepus';
$db['default']['dbdriver']='mysql';

Enter the IP address or domain name through the browser to open the monitoring interface, you can log in to the system. .The default administrator account password admin/Lepusadmin after logging in, please modify the administrator password and add a common account.

5、 Add monitoring database instance##

Configuration Center——>mysql——>New

[ root@lepus html]# tail -f /usr/local/lepus/logs/lepus.log		#Check the log and successfully add monitoring

6、 Add operating system snmp monitoring instance##

[ root@lepus html]# yum install -y net-snmp		#Install net-snmp
[ root@lepus html]# vim /etc/snmp/snmpd.conf		#Modify the configuration file, add a line
view    systemview    included   .1[root@lepus html]# systemctl start snmpd.service 	#Start service
[ root@lepus html]# systemctl enable snmpd.service 	
[ root@lepus html]# netstat -lntup|grep 161
udp        000.0.0.0:1610.0.0.0:*11888/snmpd

Configuration Center -> Operating System -> New

[ root@lepus html]# lepus stop #Restart service
[ root@lepus html]# lepus start

Successfully added snmp host operating system monitoring

At this point, the lepus installation and basic configuration are complete!
Reference from Official Document

Recommended Posts

CentOS7.2 install lepus database monitoring system
VirtualBox install CentOS system
Install Oracle11gR2 database under CentOS6.9
Install docker on Centos system
Install MongoDB database under CentOS7
Install Centos7 operating system in Docker
1.5 Install Centos7
Graphic KVM to install CentOS7.6 operating system
Install mysql8.0.13 version under Linux CentOS7 system
CentOS7 system yum way to install MySQL5.7
Centos6 install Python2.7.13
Centos7.3 install nginx
CentOS install Redmine
Centos7 install Python 3.6.
CentOS7 install MySQL
Centos7 install protobuf
CentOS7 install GlusterFS
CentOS 7.4 install Zabbix 3.4
Centos6.5 install Tomcat
CentOS install Python 3.6
Vmware install CentOS6
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
CentOS 7 install Hadoop 3.0.0
Centos7 install Python2.7
Centos 7.6 install seleniu
CentOS 7.3 install Zabbix3
Centos7 install LAMP+PHPmyadmin
centos system management
CentOS install mysql
CentOS install openjdk 1.8
CENTOS6.5 install CDH5.12.1 (1)
CentOS install PHP
CentOS6 install mist.io
Centos7 install Docker
CentOS7 install mysql
centOs install rabbitMQ
CentOS 7 install MySQL 5.6
Centos7 install Nginx
CentOS6.5 install CDH5.13
Centos7 install docker18
Centos install Python3
centos7 install docker
CentOS install jdk
centos7 install nginx-rtmp
CentOS8 install MySQL8.0
Centos6.3 install KVM
CentOS install PostgreSQL 9.1
CentOS7 install mysql8
CentOS 7 install Java 1.8
CentOS8 install fastdfs6.06
CentOS 7 install Gitlab
Centos 7 install PostgreSQL
CentOS7 install MySQL8
CentOS 7 install Java 1.8
CentOS 6 install Docker
centos 6.5 install zabbix 4.4
Centos8 install Docker
CentOS6.8 install python2.7
CentOS install nodejs 8
CentOS6.5 install GNS3