一、安装LAMP基础环境
1.
$ wget https://sourceforge.net/projects/xampp/files/XAMPP%20Linux/5.5.38/xampp-linux-x64-5.5.38-3-installer.run
$ chmod +x xampp-linux-x64-5.5.38-3-installer.run
$ ./xampp-linux-x64-5.5.38-3-installer.run
2.追加环境变量(可执行文件、库文件和头文件):
vim /etc/profile
export PATH=$PATH:/opt/lampp/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/lampp/lib
export C_INCLUDE_PATH=$C_INCLUDE_PATH:/opt/lampp/include
export PATH=$PATH:/opt/lampp/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/lampp/lib
export C_INCLUDE_PATH=$C_INCLUDE_PATH:/opt/lampp/include
:wq!:保存退出
3.source /etc/profile :生效配置
4.启动LAMP:/
opt/lampp/lampp start
二、安装MySQLdb for python
yum install MySQL-python
三、lepus安装采集器(lepus官网下载:http://www.lepus.cc/soft/17)
1.unzip lepus3.7.zip
unzip Lepus.zip
$ unzip Lepus3.8_Beta.zip
$ cd Lepus_v3.8_beta
mv lepus_v3.7 /opt/lepus/
cd lepus
#配置数据库(注意:一定要配置,不然会启动失败)
$ which mysql_config
/opt/lampp/bin/mysql_config
$ vim site.cfg
mysql_config = /opt/lampp/bin/mysql_config
保存退出命令为 :wq!
2.在监控机创建监控数据库并授权
mysql -u root
mysql> create database lepus default character set utf8;
mysql> grant select,insert,update,delete,create on lepus.* to 'lepus_user'@'localhost' identified by '123456';
mysql> grant select,insert,update,delete,create on lepus.* to 'lepus_user'@'%' identified by '123456';
mysql> flush privileges;
mysql> grant select,insert,update,delete,create on lepus.* to 'lepus_user'@'localhost' identified by '123456';
mysql> grant select,insert,update,delete,create on lepus.* to 'lepus_user'@'%' identified by '123456';
mysql> flush privileges;
3.导入SQL文件夹里的SQL文件(表结构和数据文件)
mysql lepus < sql/lepus_table.sql
mysql lepus < sql/lepus_data.sql
mysql lepus < sql/lepus_data.sql
4.被监控库的数据库只需创建lepus_monitor账号即可
mysql -u root
mysql> grant select,super,process,reload,show databases,replication client on *.* to'lepus_monitor'@'%' identified by 'MANAGER';
mysql> flush privileges;
5.安装Lpeus程序
进入到软件包的python文件夹:cd python/
授予install.sh可执行权限:chmod +x install.sh
执行安装:.
/install.sh
6.修改配置文件:
进入到安装目录,默认为/usr/local/lepus: cd /usr/local/lepus
$ cd /usr/local/lepus/
$ cat etc/config.ini
vim etc/config.ini
###监控机MySQL数据库连接地址###
[monitor_server]
host="127.0.0.1"
port=3306
user="root"
passwd=""
dbname="lepus"
7.启动Lepus (可选)
$ lepus start
lepus server start success!
$ lepus status
lepus server is running.
四、安装WEB管理台
处于/opt/lepus/路径下:
复制PHP文件夹里的文件到Apache对应的网站虚拟目录(备注:根本不同的安装方式,这个目录是不一样的,如果采用xampp安装的Apache环境,则默认程序目录为/opt/lampp/htdocs/):[root@localhost lepus_v3.7]# cp -fr php/* /opt/lampp/htdocs/
2.打开application/config/database.php文件,修改PHP连接监控服务器的数据库信息.:
$ cat /opt/lampp/htdocs/application/config/database.php
vim /opt/lampp/htdocs/application/config/database.php
$db['default']['hostname'] = '127.0.0.1';
$db['default']['port'] = '3306';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$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;
3.登录进行添加主机和监控
通过浏览器输入IP地址或域名打开监控界面,即可登录系统。.默认管理员账号密码admin/Lepusadmin登录后请修改管理员密码,增加普通账号。
参考文档:https://www.cnblogs.com/huhyoung/p/10965105.html
https://www.cnblogs.com/hankyoon/p/11011769.html