lepus3.7 天兔监控安装配置手册 CentOS6.5+mysql5.6
整体环境
192.168.1.250为监控机
192.168.1.248为被监控机
安装LAMP环境
[[email protected]~]#yum install gcc libffi-devel python-devel openssl-devel
[[email protected]~]# yum install urpmi xterm
[[email protected]]# vi /etc/ld.so.conf
/usr/lib64
[[email protected] ~]#/sbin/ldconfig
解压lamp环境包(下载地址见本文最后)
[[email protected]]# tar xvf lamp_centos64_64_version2.tar.gz -C /usr/local/
vi/usr/local/apache/conf/httpd.conf
52行修改为监控机ip Listen 192.168.1.250:80
<Listen 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
删除掉原来的替换为:
<VirtualHost*:80>
AddDefaultCharset UTF-8
DocumentRoot "/home/www/php"
ServerName mysqlmtop1.ikongjian.com
<Directory "/home/www/php">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from All
</Directory>
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
</VirtualHost>
[[email protected]]# 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
[[email protected]~]# cd /usr/local/apache/bin/
[[email protected] bin]#./apachectl start
安装Python基础模块
wget http://cdn.lepus.cc/cdncache/software/MySQLdb-python.zip
[[email protected]]# unzip MySQLdb-python.zip
[[email protected]]# cd MySQLdb1-master/
[[email protected]]# which mysql_config
/usr/local/mysql/bin/mysql_config
[[email protected]]# vi site.cfg
mysql_config = /usr/local/mysql/bin/mysql_config
[[email protected]]# python setup.py build
[[email protected]]# python setup.py install
安装Lepus采集器
安装Lepus监控系统
注:在安装Lepus系统之前,请先根据前面内容安装LAMP和Python运行基础环境。
上传软件包到监控机服务器并解压缩软件到您的系统
# unziplepus_vx.x.x.zip
在监控机创建监控数据库,并授权。
监控库
mysql> createdatabase lepus default character set utf8;
mysql> grantselect,insert,update,delete,create on lepus.* to ‘lepus_user‘@‘%‘ identified by‘MANAGER‘;
mysql> flushprivileges;
[[email protected]_v3.8_beta]# mysql -uroot -p lepus < sql/lepus_table.sql
[[email protected]_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> grantselect,super,process,reload,show databases,replication client on *.* to‘lepus_monitor‘@‘%‘ identified by ‘MANAGER‘;
mysql> flushprivileges;
安装Lpeus程序
进入到Lepus软件包的python文件夹
# cd python/
授予install.sh可执行权限
# chmod +x install.sh
执行安装
# ./install.sh
修改配置文件
进入到安装目录,默认为/usr/local/lepus
[[email protected]~]# 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
[[email protected]]# tail -f logs/lepus.log
安装WEB管理台
进入到你的lepus软件目录
[[email protected] ~]# cd/home/Lepus_v3.8_beta/
[[email protected]_v3.8_beta]# cp -r php /home/www
[[email protected] ~]# 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登录后请修改管理员密码,增加普通账号。
保存后静候1分钟,点仪表盘即可出现监控信息
本文采用的lamp环境已经上传好,下载后直接压缩至/usr/local下即可
http://down.51cto.com/data/2215658
lepus3.7可以从官网下载