CentOS搭建lepus3.8监控MysqL
yum -y install gcc libffi-devel python-devel openssl-devel MysqL-devel zlib-devel
监控端安装数据库连接Python的驱动包
1).安装 MysqLdb for python (如果需要监控MysqL则必须安装)
MysqLdb为Python连接和操作MysqL的类库,如果准备使用lepus系统监控MysqL数据库,那么该模块必须安装。
[root@jk ~]# wget http://cdn.lepus.cc/cdncache/software/MysqLdb-python.zip
[root@jk ~]# unzip MysqLdb-python.zip
[root@jk ~]# cd MysqLdb1-master/
[root@jk ~]# which MysqL_config
/usr/local/MysqL/bin/MysqL_config
[root@jk ~]# vim site.cfg 修改如下:
MysqL_config = /usr/local/MysqL/bin/MysqL_config
[root@jk ~]# python setup.py build
[root@jk ~]# python setup.py install
下载lepus3.8 官方地址
http://www.lepus.cc/soft/18
[root@jk ~]# unzip lepus3.8.zip
[root@jk ~]# cd Lepus_v3.8_beta
在监控机创建监控数据库,并授权。
监控库
[root@jk ~]# MysqL -uroot -p"ZyKJ@TeST233"
MysqL> create database lepus default character set utf8;
MysqL> grant select,insert,update,delete,create on lepus.* to 'lepus_user'@'%' identified by'MANAGER';
MysqL> flush privileges;
[root@HE3Lepus_v3.8_beta]# MysqL -uroot -p lepus < sql/lepus_table.sql
[root@HE3Lepus_v3.8_beta]# MysqL -uroot -p lepus < sql/lepus_data.sql
##### set names utf8; ######
MysqL> use lepus
MysqL> alter table MysqL_status modify column max_connect_errors bigint(18);
MysqL> alter table MysqL_status_history modify column max_connect_errors bigint(18);
被监控库
MysqL> grant select,super,process,reload,show databases,replication client on *.* to'lepus_monitor'@'localhost' identified by 'MANAGER';
MysqL> flush privileges;
安装Lpeus程序
进入到Lepus软件包的python文件夹
# cd python/
授予install.sh可执行权限
# chmod +x install.sh
执行安装
# ./install.sh
进入到安装目录,默认为/usr/local/lepus
[root@HE3~]# vi /usr/local/lepus/etc/config.ini
[monitor_server]
host="192.168.1.250"
port=4008
user="lepus_user"
passwd="MANAGER"
dbname="lepus"
重启lepus进程
ln -s /usr/local/lepus/lepus /etc/init.d/
service lepus stop
service lepus start
[root@HE3lepus]# tail -f logs/lepus.log
安装WEB管理台
进入到你的lepus软件目录
[root@HE3 ~]# cd Lepus_v3.8_beta/
[root@HE3Lepus_v3.8_beta]# cp -r PHP /home/www
[root@HE3 ~]# vim /home/www/PHP/application/config/database.PHP
$db['default']['hostname'] = '192.168.1.250';
$db['default']['port'] = '4008';
$db['default']['username'] = 'lepus_user';
$db['default']['password'] = 'MANAGER';
$db['default']['database'] = 'lepus';
$db['default']['dbdriver'] = 'MysqL';
通过浏览器打开监控界面,即可登录系统。.默认管理员账号密码admin/Lepusadmin登录后请修改管理员密码,增加普通账号。
-----
2017/04/24 16:50:32 [error] 17648#0: *100 open()
"/var/www/html/index.PHP/login" Failed (20: Not a directory),
client: 124.207.48.234,server: 221.195.1.233,request: "GET
/index.PHP/login?return_url=http://221.195.1.233:8080/index.PHP
HTTP/1.1",host: "221.195.1.233:8080"
-----报错信息
MysqL> use lepus
MysqL> update admin_user set password=md5("ZykJ@testAdmin") where user_id=1;
MysqL> update admin_user set username='zykj_admin' where user_id=1;
zykj_admin ZykJ@testAdmin