Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Real-time Open Source Monitoring system for lepus Database

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

one。 Installation environment

System environment: centos6.5 IP:192.168.30.242 hostname:***.org

Software: LAMP has been installed. (make sure these are installed properly and can be used).

System core package: (extracted from official data)

1.MySQL 5.0and above (must, be used to store data collected by monitoring system) 2.Apache 2.2and above (must, WEB server runs server) 3.PHP 5.3or above (must, provide WEB interface support) 4.Python2 (must, recommend version 2.6and above, perform data acquisition and alarm tasks Does not support Python3) 5.Python connection and monitoring database related driver module package: MySQLdb for python (Python connection MySQl interface) For monitoring MySQL, this module must be installed) cx_oracle for python (interface for Python to connect to Oracle, optional, if you need to monitor oracle this module must be installed) Pymongo for python (interface for Python to connect to MongoDB, optional, if you need to monitor MongoDB this module must be installed) redis-py for python (interface for Python to connect to Redis, optional, if you need to monitor Redis this module must be installed)

two。 Install (install the python base module first)

Install the Python base module (Python is installed by default in Linux. )

MySQLdb module is used as a class library for Python to connect and operate mysql. If you want lepus system to monitor mysql database, this module must be installed.

[root@*** ~] # mkdir lepus [root@*** lepus] # wget http://cdn.lepus.cc/cdncache/software/MySQLdb-python.zip[root@*** lepus] # unzip MySQLdb-python.zip [root@*** lepus] # cd MySQLdb1-master/ [root@*** lepus] # which mysql_config (find the location of the mysql_config command here, mysql installed in different ways may be different! ) / usr/bin/mysql_ config [root @ * MySQLdb1-master] # pwd/root/lepus/MySQLdb1-master [root@*** MySQLdb1-master] # vi site.cfg mysql_config = / usr/bin/mysql_config (fill in the last location found)

This time, the lepus is created in the root directory, and then all the software that needs to be downloaded on this machine is stored in this directory. After configuring ok, the following is the compilation and installation of the module

[root@*** MySQLdb1-master] # python setup.py build [root@*** MySQLdb1-master] # python setup.py install

Install the Redis module (required for monitoring Redis)

[root@*** MySQLdb1-master] # cd.. [root@*** lepus] # pwd/root/lepus [root@*** lepus] # wget http://cdn.lepus.cc/cdncache/software/redis-py-2.10.3.tar.gz[root@*** lepus] # tar zxvf redis-py-2.10.3.tar.gz [root@*** lepus] # cd redis-2.10.3/ [root@*** redis-2.10.3] # python setup.py install

Install the pymongo module (required for monitoring Mongodb)

[root@*** redis-2.10.3] # cd.. [root@*** lepus] # pwd/root/lepus [root@*** lepus] # wget http://cdn.lepus.cc/cdncache/software/pymongo-2.7.tar.gz[root@*** lepus] # tar zxvf pymongo-2.7.tar.gz [root@*** lepus] # cd pymongo-2.7 [root@*** pymongo-2.7] # python setup.py install

Test whether each module installation is running properly (the test file is under / root/lepus/lepus_v3.7/python/)

[root@*** pymongo-2.7] # cd / root/lepus/lepus_v3.7/python/ [root @ * pymongo-2.7] # pwd/root/lepus/lepus_v3.7/ python [root @ * python] # python test_driver_mysql.py MySQL python drivier is ok! [root@*** python] # python test_driver_redis.py Redis python drivier is ok! [root@*** python] # python test_driver_mongodb.py MongoDB python drivier is ok!

To install the lepus software (also known as Sky Rabbit in Chinese), download it from the official website and put it in the / root/lepus directory.

[root@*** lepus] # unzip Lepus Database Enterprise Monitoring system 3.7 official download .zip

Then create the database and authorize

[root@*** lepus] # mysqlmysql > create database lepus default character set utf8;mysql > grant select,insert,update,delete,create on lepus.* to 'lepus_user'@'localhost' identified by' xxxxxxxxx';mysql > flush privileges

Import SQL files (table structure and data files) in the SQL folder

[root@*** lepus] # mysql-uroot-p lepus < sql/lepus_ table.sql [root @ * lepus] # mysql-uroot-p lepus < sql/lepus_data.sql

Install the lpeus main program

[root@*** lepus] # pwd/root/lepus [root@*** lepus] # cd lepus_v3.7/python/ [root @ * python] # chmod + x install.sh [root@*** python] #. / install.sh [note] lepus will be install on basedir: / usr/local/lepus [note] / usr/local/lepus directory does not exist Will be created. [note] / usr/local/lepus directory created success. [note] wait copy files. [note] change script permission. [note] create links. [note] install complete.

Modify lepus configuration file

[root@*** python] # cd / usr/local/lepus/ [root@*** lepus] # vim etc/config.ini # Monitoring computer MySQL database connection address # [monitor_server] host= "127.0.0.1" port=3306user= "lepus_user" passwd= "xxxxx" where the password is the dbname= "lepus" used for authorization

Well, if there is no problem with the above, you can start Lepus now

[root@*** lepus] # lepus start

Now that lepus is installed, we need web visual management and a web console.

Install the web Management desk

Copy the files in the php folder to the root directory of the apache website (the installation method is different, the directory is also different, the local LAMP environment is yum installation, the default document is / var/www/html)

[root@*** ~] # cd / root/lepus/lepus_v3.7/ [root @ * lepus_v3.7] # cp-rf php/* / var/www/html/

Then modify the database.php file to fill in some database information used to connect to the monitoring server

[root@*** lepus_v3.7] # vim / var/www/html/php/application/config/database.php$db ['default'] [' hostname'] = 'localhost';$db [' default'] ['port'] =' 3306 [default'] ['username'] =' lepus_user'; $db ['default'] [' password'] = 'xxxxxxx';$db [' default'] ['database'] =' lepus';$db ['default'] [' dbdriver'] = 'mysql' $db ['default'] [' dbprefix'] ='; $db ['default'] [' pconnect'] = TRUE;$db ['default'] [' db_debug'] = TRUE;$db ['default'] [' cache_on'] = FALSE;$db ['default'] [' cachedir'] =''; $db ['default'] [' char_set'] = 'utf8';$db [' default'] ['dbcollat'] =' utf8_general_ci';$db ['default'] [' swap_pre'] ='' $db ['default'] [' autoinit'] = TRUE;$db ['default'] [' stricton'] = FALSE

Now you can open the browser, enter the ip address, the default page is http://ip/php, to log in to the system, the default administrator account is admin, password Lepusadmin, remember to change the password.

Show the page of the monitoring system

The surveillance screen is still pretty good.

As a novice in operation and maintenance, it is relatively easy to build this. Thanks to the developers of this software. Good. Some of the contents of this article refer to the documentation: http://www.lepus.cc/manual/index.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report