1 安装配置
1.1 安装配置基础环境
[root@test ~]#: yum install -y httpd php php-mysql mariadb-server
[root@test ~]#: systemctl start mariadb
[root@test ~]#: systemctl status mariadb
[root@test ~]#: systemctl start httpd
[root@test ~]#: systemctl status httpd
1.2 安装天兔项目
[root@test ~]#: ll
总用量 6604
-rw-r--r-- 1 root root 6760286 5月 17 18:23 Lepus数据库企业监控系统3.7版本官方下载.zip
[root@test ~]#: unzip Lepus数据库企业监控系统3.7版本官方下载.zip
上传代码到站点目录下修改权限
[root@test ~]#: mv lepus_v3.7/ /var/www/html/
[root@test ~]#: chown -R apache. /var/www/html/
[root@test ~]#: mv /var/www/html/lepus_v3.7/php/* /var/www/html/
配置数据库信息
[root@test sql]#: mysql
MariaDB [(none)]> create database lepus;
[root@test sql]#: mysql lepus < /var/www/html/lepus_v3.7/sql/lepus_table.sql
[root@test sql]#: mysql lepus < /var/www/html/lepus_v3.7/sql/lepus_data.sql
配置数据库信息
[root@test html]#: vim /var/www/html/application/config/database.php
51 $db['default']['hostname'] = '127.0.0.1';
52 $db['default']['port'] = '3306';
53 $db['default']['username'] = 'root';
54 $db['default']['password'] = '';
55 $db['default']['database'] = 'lepus';
56 $db['default']['dbdriver'] = 'mysql';
57 $db['default']['dbprefix'] = '';
58 $db['default']['pconnect'] = TRUE;
59 $db['default']['db_debug'] = TRUE;
60 $db['default']['cache_on'] = FALSE;
61 $db['default']['cachedir'] = '';
62 $db['default']['char_set'] = 'utf8';
63 $db['default']['dbcollat'] = 'utf8_general_ci';
64 $db['default']['swap_pre'] = '';
65 $db['default']['autoinit'] = TRUE;
66 $db['default']['stricton'] = FALSE;
2 MySQL监控模块
2.1 安装MySQL监控模块
[root@test ~]#: unzip MySQLdb-python.zip
[root@test MySQLdb1-master]#: cd MySQLdb1-master/
[root@test MySQLdb1-master]#: yum install mariadb-devel -y
[root@test MySQLdb1-master]#: which mysql_config
/usr/bin/mysql_config
[root@test MySQLdb1-master]#: vim site.cfg
13 mysql_config = /usr/bin/mysql_config 修改路径位刚才which的路径
2.2编译安装python模块
[root@test MySQLdb1-master]#: vim distribute_setup.py
50 DEFAULT_URL = "https://pypi.python.org/packages/source/d/distribute/" 把http改成https
[root@test MySQLdb1-master]#: python setup.py build
[root@test MySQLdb1-master]#: yum install -y python-devel.x86_64
[root@test MySQLdb1-master]#: python setup.py build
[root@test MySQLdb1-master]#: python setup.py install
2.3测试驱动是否正常运行
[root@test MySQLdb1-master]#: cd /var/www/html/lepus_v3.7/python/
[root@test python]#: python test_driver_mysql.py
MySQL python drivier is ok!
2.4启动lepus
[root@test python]#: bash install.sh
[root@test python]#: chmod +x lepus
[root@test python]#: lepus start
nohup: 把输出追加到"nohup.out"
lepus server start success!
启动失败的话编辑配置文件,加上数据库密码
[root@test lepus]#: vim /usr/local/lepus/etc/config.ini
###监控机MySQL数据库连接地址###
[monitor_server]
host="127.0.0.1"
port=3306
user="root"
passwd=""
dbname="lepus"
2.5配置MySQL监控
3 主机监控配置
用过snmp采集数据
[root@test ~]#: yum install net-snmp net-snmp-utils -y
[root@test ~]#: vim /etc/snmp/snmpd.conf 编写配置文件
55 view systemview included .1
56 view systemview included .1.3.6.1.2.1.1
57 view systemview included .1.3.6.1.2.1.25.1.1
[root@test ~]#: systemctl start snmpd.service
[root@test ~]#: systemctl enable snmpd.service
4 报警设置
全局设置里配置报警信息
修改报警条件
清除报警后会发送ok的邮件