lepus天兔數據庫監控

本篇文章的前提是服務器裝了mysql服務、git,我這邊就不寫出來了,自行百度,裝下mysql服務,比較簡單

1、安裝LAMP基礎環境

Xampp下載地址:https://www.apachefriends.org/download.htmlphp

Xampp幫助文檔:https://www.apachefriends.org/faq_linux.htmlhtml

官方推薦版本:xampp-linux-x64-1.8.2-5-installer.runpython

其實我本身都不是用的官方推薦版本,我在官網下載了一個最新mysql

安裝過程很是簡單 wget方式安裝linux

一、wget http://cdn.lepus.cc/cdncache/software/xampp-linux-x64-1.8.2-5-installer.rungit

若是404。直接下載到本地,再用xshell傳到linux服務器上面去github

二、chmod +x xampp-linux-x64-1.8.2-5-installer.runweb

三、./xampp-linux-x64-1.8.2-5-installer.runsql

四、一直 按y  (會提示y或者N)shell

Setup is now ready to begin installing XAMPP on your computer. 
Do you want to continue? [Y/n]: y 
—————————————————————————- 
Please wait while Setup installs XAMPP on your computer. 
Installing 
0% ______________ 50% ______________ 100% 
######################################### 
—————————————————————————- 
Setup has finished installing XAMPP on your comput

 2、安裝Python基礎模塊

安裝Lepus採集器
pip install mysql-python

在MySQL-python安裝成功後,就能夠在python中引入MySQLdb了

3、

1)下載軟件安裝包

#  cd /usr/local
#  git clone https://github.com/ruzuojun/lepus.git

2)對可執行文件受權,並建立軟鏈接

#  cd lepus
#  chmod +x lepus*
# ln -s /usr/local/lepus/lepus /usr/local/sbin/lepus
# ln -s /usr/local/lepus/lepus_monitor /usr/local/sbin/lepus_mointor

3).在監控機建立監控數據庫,並受權。

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

4)導入SQL文件夾裏的初始化SQL文件(表結構和數據文件)

/usr/local/lepus/sql   這個地方執行如下2個語句

# mysql -uroot -p lepus < sql/lepus_table.sql

# mysql -uroot -p lepus < sql/lepus_data.sql

5) 修改配置文件

進入到安裝目錄/usr/local/lepus

# cd /usr/local/lepus/
# vim etc/config.ini

監控機MySQL數據庫鏈接地址

[monitor_server]
host="127.0.0.1"
port=3306
user=" root "
passwd="123456"
dbname="lepus"

6) 啓動Lepus)

此時,你能夠執行啓動命令啓動lepus採集進程(這裏好坑啊,幾回失敗,最後看日誌,才發現問題

# lepus start
lepus server start success!
驗證lepus啓動沒有:
# ps -ef|grep lepus

 

若是啓動失敗,能夠經過記錄的日誌信息查看錯誤,經過log信息咱們能夠定位啓動失敗的問題:# tail -f logs/lepus.log

4、安裝WEB管理臺

複製lepus/web文件夾裏的文件到Apache對應的網站虛擬目錄(備註:根據不一樣的安裝方式,這個目錄是不同的,若是採用xampp安裝的Apache環境,則默認程序目錄爲/opt/lampp/htdocs/

這樣的話  lepus下面的php文件夾就有文件了

建立文件夾    mkdir /opt/lampp/htdocs/lepus

拷貝安裝文件  cp -rf lepus/web/* /opt/lampp/htdocs/lepus

編輯配置文件  vi /opt/lampp/htdocs/lepus/web/application/config/database.php

$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';
 
重啓xampp   /opt/lampp/lampp restart
啓動lepus    lepus start

5、登陸進行添加主機和監控

經過瀏覽器輸入IP地址或域名打開監控界面,便可登陸系統。.默認管理員帳號密碼admin/Lepusadmin登陸後請修改管理員密碼,增長普通帳號

即:訪問http://127.0.0.1/lepus/web(記得關防火牆或者設置防火牆策略)
默認帳號密碼admin/Lepusadmin

 

 我本身已經檢測了本身的QA服務器,以下

相關文章
相關標籤/搜索