lepus3.7 天兔监控安装配置手册 CentOS6.5+mysql5.6

整体环境

192.168.1.250为监控机

192.168.1.248为被监控机

 

安装LAMP环境

 

[root@HE3~]#yum install gcc libffi-devel python-devel openssl-devel

 

[root@HE3~]# yum install urpmi xterm

[root@HE3mysqlmtop]# vi /etc/ld.so.conf

/usr/lib64

[root@HE3 ~]#/sbin/ldconfig

 

解压lamp环境包(下载地址见本文最后)

[root@HE3mysqlmtop]# tar xvf lamp_centos64_64_version2.tar.gz -C /usr/local/

该包我已上传至51cto下载中心:http://down.51cto.com/data/2215658

vi/usr/local/apache/conf/httpd.conf

52行修改为监控机ip Listen 192.168.1.250:80

---

>Listen 192.168.1.250:80

147行取消注释

<#LoadModule rewrite_module modules/mod_rewrite.so

---

>LoadModule rewrite_module modules/mod_rewrite.so

190行改为监控机ip

<#ServerName www.example.com:80

---

>ServerName 192.168.1.250:80

199行添加注释

<     Require all denied

---

>#    Require all denied

248添加index.php

<     DirectoryIndex index.html

---

>     DirectoryIndex index.html index.php

447行取消注释

<#Include conf/extra/httpd-mpm.conf

---

>Include conf/extra/httpd-mpm.conf

465行取消注释

<#Include conf/extra/httpd-vhosts.conf

---

>Include conf/extra/httpd-vhosts.conf

 

 

 

 

 

 

vi/usr/local/apache/conf/extra/httpd-vhosts.conf

删除掉原来的替换为:

 

    AddDefaultCharset UTF-8

    DocumentRoot "/home/www/php"

    ServerName mysqlmtop1.ikongjian.com

    /home/www/php">

        Options FollowSymLinks

        AllowOverride All

        Order allow,deny

        Allow from All

   

    ErrorLog"|/usr/local/apache/bin/rotatelogs /home/logs/apache/php_%Y%m%d_error.log86400 480"

    CustomLog"|/usr/local/apache/bin/rotatelogs /home/logs/apache/php_%Y%m%d_access.log86400 480" common

 

 

[root@HE3lepus]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain

::1         localhost6 localhost6.localdomain6

192.168.1.248   HE1

192.168.1.249   HE2

192.168.1.250   HE3 mysqlmtop1.ikongjian.com

192.168.1.251   HE4

 

 

 

 

 

[root@HE3~]# cd /usr/local/apache/bin/

[root@HE3 bin]#./apachectl start

 

 

 

 

 

安装Python基础模块

wget http://cdn.lepus.cc/cdncache/software/MySQLdb-python.zip

[root@HE3mysqlmtop]# unzip MySQLdb-python.zip

[root@HE3mysqlmtop]# cd MySQLdb1-master/

[root@HE3MySQLdb1-master]# which mysql_config

/usr/local/mysql/bin/mysql_config

 

[root@HE3MySQLdb1-master]# vi site.cfg

mysql_config = /usr/local/mysql/bin/mysql_config

 

[root@HE3MySQLdb1-master]# python setup.py build

[root@HE3MySQLdb1-master]# python setup.py install

 

 

 

 

安装Lepus采集器

安装Lepus监控系统

注:在安装Lepus系统之前,请先根据前面内容安装LAMP和Python运行基础环境。

上传软件包到监控机服务器并解压缩软件到您的系统

# unziplepus_vx.x.x.zip

在监控机创建监控数据库,并授权。

监控库

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

 

mysql>use lepus

mysql>alter tablemysql_status modify column max_connect_errors bigint(18);

mysql>alter tablemysql_status_history modify column max_connect_errors bigint(18);

被监控库

mysql> grant select,super,process,reload,show databases,replication client on *.* to'lepus_monitor'@'%' 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

###监控机MySQL数据库连接地址###

[monitor_server]

host="192.168.1.250"

port=4008

user="lepus_user"

passwd="MANAGER"

dbname="lepus"

 

 

 

 

 

 

重启lepus进程

/usr/local/lepus/lepusstop

/usr/local/lepus/lepusstart

 

[root@HE3lepus]# tail -f logs/lepus.log

 

 

 

安装WEB管理台

进入到你的lepus软件目录

[root@HE3 ~]# cd/home/Lepus_v3.8_beta/

[root@HE3Lepus_v3.8_beta]# cp -r php /home/www

 

 

[root@HE3 ~]# vi/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';

 

登录进行添加主机和监控

通过浏览器输入mysqlmtop1.ikongjian.com打开监控界面,即可登录系统。.默认管理员账号密码admin/Lepusadmin登录后请修改管理员密码,增加普通账号。

lepus3.7 天兔监控安装手册 CentOS6.5+mysql5.6_第1张图片


保存后静候1分钟,点仪表盘即可出现监控信息

 


lepus3.7 天兔监控安装手册 CentOS6.5+mysql5.6_第2张图片



lepus3.7 天兔监控安装手册 CentOS6.5+mysql5.6_第3张图片


 

本文采用的lamp环境已经上传好,下载后直接压缩至/usr/local下即可

http://down.51cto.com/data/2215658

lepus3.7可以从官网下载