方法1
系统:centos6.5
该汉化包默认支持kibana5.x - 6.x任意版本
下载汉化包路径:https://github.com/anbai-inc/Kibana_Hanization/archive/master.zip
解压上传至linux系统
unzip master.zip
cd master
在解压路径下
#汉化
执行python main.py Kibana目录
# 启动elasticsearch
cd elasticsearch-6.3.0/bin
elasticsearch -d
# 启动kibana
cd kibana-6.3.0-linux-x86_64/bin
kibana
执行后即可汉化成功
浏览器访问 localhost:5601
在/kibana/config/kibana.yml 中修改,
添加i18n.locale: zh-CN
注意, 上面冒号: 和 zhe-CN 之间必须有个空格,否则kibana无法启动 。
i18n.locale: zh-CN #在最后面,去掉前面的#号
zh-CN 表示 “中国大陆地区使用的中文” --> “简体中文”
加上之后,先杀掉kibana进程:
//杀死kibana进程
ps -ef | grep node
然后重启kibana。
方法2、
上传汉化包,英文版的kibana我是用不明白,汉化包下载地址:
https://github.com/anbai-inc/Kibana_Hanization
上传至服务器然后解压
unzip kibana-hanhua.zip
拷贝此项目中的translations文件夹到您的kibana目录下的src/legacy/core_plugins/kibana/目录
cd Kibana_Hanization-master/
cp -r translations/ /usr/share/kibana/src/legacy/core_plugins/kibana/
修改您的kibana配置文件kibana.yml中的配置项:i18n.locale: “zh-CN”
vim /etc/kibana/kibana.yml
#i18n.locale: "en"
i18n.locale: "zh-CN"
注意python的版本不能过高,3.6的版本我试过是汉化不了的,换成2.7的可以了
python main.py /home/kibana-6.2.3/ #开始汉化。
启动命令在kibana的bin下的kibana
后台启动:
nohup ./bin/kibana &
基于Kibana的可视化监控报警插件 KAAE 的配置
介绍
可视化监控报警插件 KAAE:Kibi + Kibana Alert & Report App for Elasticsearch。
KAAE安装
注意:sentinl.zip的版本和Kibana的版本需要相互对应。
方式1:/elk/kibana/bin/kibana-plugin install
https://github.com/sirensolutions/sentinl/releases/download/tag-5.4.0/sentinl.zip
方式2:git clone https://github.com/sirensolutions/sentinl
安装nodejs(npm):yum install -y nodejs
安装Gulp(本文为全局安装):npm install -g gulp
安装rsync:yum install rsync
#cd sentinl
#npm install
#gulp package
/elk/kibana/bin/kibana-plugin install file://`pwd`/target/gulp/sentinl.zip
安装完成后,浏览器输入:http://ip:5601出现以下界面说明插件安装成功
2.KAAE配置
这是一份新建watchers后的默认配置
{
"_index": "watcher",
"_type": "watch",
"_id": "new_watcher_jy9qwqzz9",
"_score": 1,
"_source": {
"title": "watcher_title",
"disable": true,
"uuid": "new_watcher_jy9qwqzz9",
"trigger": {
"schedule": {
"later": "every 5 minutes"
}
},
"input": {
"search": {
"request": {
"index": [],
"body": {}
}
}
},
"condition": {
"script": {
"script": "payload.hits.total > 100"
}
},
"transform": {
"script": {
"script": ""
}
},
"actions": {
"email_admin": {
"throttle_period": "15m",
"email": {
"to": "alarm@localhost",
"from": "sentinl@localhost",
"subject": "Sentinl Alarm",
"priority": "high",
"body": "Found {{payload.hits.total}} Events"
}
}
}
}
}
主要配置分为两步
1. kibana.yml配置
配置发件箱信息,在kibana.yml最后添加如下内容
sentinl:
settings:
email:
active: true
user: xxx@163.com //邮箱账号
password: xxxxxxx //邮箱密码(第三方登录密码)
host: smtp.server.com // 邮箱smtp 服务器地址
ssl: true
report:
active: true
tmp_path: /tmp/
2.配置watchers信息
watchers配置主要为General、Input、Condition、Transform、Actions的配置。其中General为基本配置,设置报警触发时长,Input为限制报警源,Condition为报警触发条件,Action为报警时的邮件设置。Raw为总体配置展现。
本文配置后具体Raw如下所示
{
"_index": "watcher",
"_type": "watch",
"_id": "new_watcher_bzd9kgjzi",
"_score": 1,
"_source": {
"title": "Alerm",
"disable": false,
"uuid": "new_watcher_bzd9kgjzi",
"trigger": {
"schedule": {
"later": "every 1 hours" //执行时间为1小时
}
},
"input": {
"search": {
"request": {
"body": {
"query": {
"bool": {
"must": [
{
"query_string": {
"fields": [
"body^5",
"_all"
],
"query": "ERROR~", //限制报警源为出错ERROR的日志
"use_dis_max": true
}
},
{
"range": {
"@timestamp": {
"gte": "now-1h", //对进1小时的日志进行检测
"lte": "now",
"format": "epoch_millis"
}
}
}
],
"must_not": []
}
}
}
}
}
},
"condition": {
"script": {
"script": "payload.hits.total>=1" //当报警条件为ERROR出现的次数大于1
}
},
"transform": {
"script": {
"script": ""
}
},
"actions": {
"AlermNeon": {
"throttle_period": "1h0m0s",
"email": {
"to": "yyyg@163.com", //接收报警的邮箱
"from": "xxxx@163.com",//发送报警的邮箱(与kibana.yml配置中一致)
"subject": "Sentinl Alarm",
"priority": "high",
"body": "Alerm of neon: {{payload.hits.total}} !" //邮件内容
}
}
}
}
}
到此为止,KAAE(Sentinl)就配置好了。
3.KAAE报警展示
在完成第2部分后,我们启动watchers。
在触发报警时,我们可以看到kibana的日志如下所示
或者在kibana界面sentinl插件中查看报警信息如下所示
当然,如果在报警周期中不存在符合条件的报警,在上述界面是无记录的,我们可以再kibana日志中找到如下信息
参考链接 :
ELK搭建及kibana界面汉化 : https://blog.csdn.net/weixin_34206899/article/details/91678058?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task
https://blog.csdn.net/Gekkoou/article/details/80956191?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task
https://blog.csdn.net/whg18526080015/article/details/73812400?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task
kibana界面汉化 : https://blog.csdn.net/qq_28449663/article/details/79868334?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task