sentinl是什么

  • Kibi/Kibana Alert & Reporting App
  • Watching your data, 24/7/365

sentinl是一个免费的kibana预警与报告插件,与付费软件X-Pack功能类似。

Some Examples for illustration:

  • HIT COUNT PER HOUR
  • QUESTION: How many hits does index X receive hourly?
  • WATCHER: query index and return count of hits in last hour
  • ACTION: Notify with number of Hits per hour
  • METRIC THRESHOLDS
  • QUESTION: Is any of my monitored metrics surpassing a certain value?
  • WATCHER: query index and type for specific values, aggregated by an arbitrary field.
  • ACTION: Notify with aggs bucket details every time a threshold is surpassed or spike anomaly detected.
  • BLACKLISTS HITS
  • QUESTION: Is any of my users trying to reach blacklisted destinations?
  • WATCHER: query firewall logs comparing destination IPs to a blacklist.
  • ACTION: Notify admin via email if any IP >= 10 matches returned
  • FAILED LOGINS
  • QUESTION: Are there recurring failure attempts authenticating users on my network?
  • WATCHER: query active directory logs for login failures in last hour and compare to user index. .
  • ACTION: Notify admin via webhook if >= 10 matches returned
  • LEAK DETECTION (chain)
  • QUESTION: Are there any public leaks about my data I was not aware of?
  • WATCHER: query for user emails included in published leaks ingested from third parties.
  • ACTION: Save hits in secondary result Index. Notify via email if leak was not known in a secondary Watcher

安装

./kibana-plugin install file:./sentinl-v6.0.1.zip

安装完成后,要重启kibana

fuser -n tcp 5601
ps -ef | grep node
kill -9 pid ./kibana &

使用步骤

使用包括5个步骤

  • Step 1: New Watcher

give our Watcher a name and choose an execution frequency

  • Step 2: Input Query

es的搜索与聚合

  • Step 3: Condition

validate if the results received back are worth processing

语法与x-pack script condition语法类似

相当于过滤条件

"condition": {
"script": {
"script": "payload.hits.total>=1" //当报警条件为***出现的次数大于1
}
} "condition": {
"script": {
"script": "payload.hits.hits[0]._source.responsetime > 0.01" // 检索条件 响应时间大于 0.01秒
}
}
  • Step 4: Transform

Our data might need adjustments or post processing. Process our payload using a javascript expression/script

事后处理

  • Step 5: Actions

Let's form a notification using the mustache templating language。

可以采用多种方式发送通知。

transform

How to Adapt or Post-Process data

Post Process事后的处理。

The transform script is the wild member of the family and can be used to inject simple or complex logic into the pipeline before delivery to actions using pure javascript.

From converting format types, through generating brand new payload keys and interpolating data, transform is the way up. The script expects a boolean condition to trigger actions. A false condition can be forced to stop the execution. BONUS: Transforms can be saved and used across Watchers! "transform": { "script": { "script": "payload.newvar = payload.aggs.some.values['95.0']" } }

action举例之邮件发送

kibana.yml

logging.verbose: true
sentinl:
settings:
email:
active: true
host: smtp.exmail.qq.com
ssl: false
report:
active: true
tmp_path: /tmp/ 上面是官网的,下面是实践已OK
sentinl:
settings:
email:
active: true
user: tanyk@huawangtech.com
password: Dd@2016
host: smtp.exmail.qq.com
ssl: true
timeout: 10000
report:
active: true
tmp_path: /tmp/

先测试

mailx -S smtp=<smtp-server-address> -r <from-address> -s <subject> -v <to-address> < body.txt
yum -y install sendmail
yum install -y sendmail-cf /etc/init.d/sendmail start
chkconfig sendmail on
yum install -y mailx

vim /etc/mail.rc(optional)

set from=tanyk@mail.com
set smtp=smtp.exmail.qq.com
set smtp-auth-user=tanyk@mail.com
set smtp-auth-password=******
set smtp-auth=login
set nss-config-dir="/etc/pki/nssdb/"

test

echo "This is the message body and contains the message" | mailx -v -r "tanyk@mail.com" -s "This is the subject" -S smtp="smtp.exmail.qq.com" -S smtp-use-starttls -S smtp-auth=login -S smtp-auth-user="tanyk@mail.com" -S smtp-auth-password="******" -S ssl-verify=ignore -S nss-config-dir="/etc/pki/nssdb/" tanyk@163.com

参考文献

基于Kibana的可视化监控报警插件sentinl入门的更多相关文章

  1. ELK之Kibana的可视化监控报警插件sentinl的配置

    参考:https://www.bbsmax.com/A/gGdXbgXmJ4/ https://www.deathearth.com/333.html  https://www.cnblogs.com ...

  2. Kibana 可视化监控报警插件 KAAE 的介绍与使用

    https://blog.csdn.net/phachon/article/details/53424631 https://blog.csdn.net/Dragon714/article/detai ...

  3. JVM调优(二)——基于JVisualVM的可视化监控

    JVM调优(二)--基于JVisualVM的可视化监控 工具路径://java/jdk1.8xxx/bin/JVisuaVM.exe 监控本地的Tomcat 监控远程Tomcat 监控普通的JAVA进 ...

  4. 手把手教你基于C#开发WinCC语音报警插件「附源代码」

    写在前面 众所周知,WinCC本身是可以利用C脚本或者VBS脚本来做语音报警,但是这种方式的本质是调用已存在的音频文件,想要实现实时播报报警信息是不行的,灵活性还不够,本文主要介绍基于C#/.NET开 ...

  5. Kibana插件sentinl实现邮件报警

    为什么会突然想用到对日志的异常内容进行邮件报警,是因为在上周公司的线上业务多次出现锁表,开发在优化sql的同时,我也在想是不是可以对日志的异常内容进行检测并实现邮件预警. 在网上查询了一些资料后,决定 ...

  6. Kibana插件sentinl使用教程

    简介 对于Kibana的一些数据我们有时候是想要对某些字段进行持续关注的,这时候通过报警的手段就可以大幅提升对这些信息状态了解的及时性及可靠性.使用sentinl插件就可以帮助我们实现这个功能. 此教 ...

  7. 基于 HTML5 WebGL 的智慧楼宇三维可视化监控

    前言 可视化的智慧楼宇在 21 世纪是有急迫需求的,中国被世界称为"基建狂魔",全球高层建筑数量位居首位,所以对于楼宇的监控是必不可少.智慧楼宇可视化系统更多突出的是管理方面的功能 ...

  8. 基于ELK 7.50搭建elastalert 监控报警和权限控制

    ELK+监控报警全步骤 需求: 公司要求对出在windows服务器上的日志进行日志分析并根据关键字进行报警,并配置kibana权限控制.下面为详细步骤 环境: centos 7.6 elk版本7.50 ...

  9. 基于 WebGL 的 HTML5 楼宇自控 3D 可视化监控

    前言 智慧楼宇和人们的生活息息相关,楼宇智能化程度的提高,会极大程度的改善人们的生活品质,在当前工业互联网大背景下受到很大关注.目前智慧楼宇可视化监控的主要优点包括: 智慧化 -- 智慧楼宇是一个生态 ...

随机推荐

  1. 新建ASPX页面,并练习div布局和table布局

    1,Div水平居中: <div style="margin:0px auto;width:100px;height:100px;background:#FF0000;"> ...

  2. [Nowcoder212D]禁书目录_概率期望

    禁书目录 题目大意:清教需要定期给Index清除记忆,在此之前需要把当中的十万三千本禁书取出来......不幸的是,禁书一旦离开了Index就非常脆弱,具体来说,每一本禁书都有一个魔力值 ai ,其记 ...

  3. [转帖]华为Mate20 X 5G版拆解:巴龙5000还配备了3GB独立内存!

    华为Mate20 X 5G版拆解:巴龙5000还配备了3GB独立内存! 投递人 itwriter 发布于 2019-07-29 21:35 评论(7) 有1733人阅读 原文链接 [收藏] « » h ...

  4. 服务器:消息18456,级别16,状态1 用户‘sa’登录失败解决方法

    无法连接到服务器**:  服务器:消息18456,级别16,状态1   [Microsoft][ODBC   SQL   Server   Driver][Sql   server]   用户 'sa ...

  5. PAT B1031 查验身份证(15)

    AC代码 #include <cstdio> #include <iostream> using namespace std; const int max_n = 110; / ...

  6. Unknown custom element: <swiper>

    刚开始使用VUE,一直提示这个,后来才发现是注册组件时注册反了:先新建VUE实例再注册组件是问题根源,调转一下顺序即可解决

  7. Jmeter之正则表达式取样器~案例详解

    正则:按照规则提取数据 场景:A请求获得的响应数据,需要作为B请求的提交数据(eg:A:购物车页面→B:下单(正则提取购物车的商品信息,数量信息等)) 常用正则表达式:(.+?) 辅助:添加Debug ...

  8. k-means算法处理聚类标签不足的异常

    k-means算法在人群聚类场景中,是一个非常实用的工具.(该算法的原理可以参考K-Means算法的Python实现) 常见调用方式 该算法常规的调用方式如下: # 从sklearn引包 from s ...

  9. Leaf Sets CodeForces - 1042F (树,最小划分)

    大意: 给定树, 求叶子的最小划分, 使得每个划分内任意两个叶子距离不超过k. 任选一个非叶结点, 贪心合并. #include <iostream> #include <sstre ...

  10. C C语言中 *.c和*.h文件的区别!

    一个简单的问题:.c和.h文件的区别学了几个月的C语言,反而觉得越来越不懂了.同样是子程序,可以定义在.c文件中,也可以定义在.h文件中,那这两个文件到底在用法上有什么区别呢? 2楼:子程序不要定义在 ...