1.下载相应版本的sentinl
10年积累的网站设计、
网站建设经验,可以快速应对客户对网站的新想法和需求。提供各种问题对应的解决方案。让选择我们的客户得到更好、更有力的网络服务。我虽然不认识你,你也不认识我。但先
网站设计后付款的网站建设流程,更有
洮南免费网站建设让你可以放心的选择与我们合作。 wget https://github.com/sirensolutions/sentinl/releases/download/tag-6.6.1/sentinl-v6.6.1.zip
2.kiban集成安装插件
kibana-plugin install file:///home/cloud/software/sentinl-v6.6.1.zip
3.配置邮件
sentinl:
settings:
email:
active: true
user: l用户名
password: 邮箱客户端授权码
host: smtp.exmail.qq.com
ssl: true
port: 465
timeout: 10000
4.重启kibana
systemctl restart kibana
5.kibana设置
6.查看高级配置
{
"actions": {
"email_html_alarm_76b83c8f-0f4a-4db5-8a15-185933e17ca2": {
"name": "项目credit-manager日志告警",
"throttle_period": "2m",
"email_html": {
"stateless": false,
"subject": "项目credit-manager日志告警",
"priority": "medium",
"html": "
Hi {{watcher.username}}
\n
There are {{payload.hits.total}} results found by the watcher {{watcher.title}}.
\n\n
\n
\n
This watcher sends alerts based on the following criteria:
\n
- {{watcher.wizard.chart_query_params.queryType}} of {{watcher.wizard.chart_query_params.over.type}} over the last {{watcher.wizard.chart_query_params.last.n}} {{watcher.wizard.chart_query_params.last.unit}} {{watcher.wizard.chart_query_params.threshold.direction}} {{watcher.wizard.chart_query_params.threshold.n}} in index {{watcher.wizard.chart_query_params.index}}
\n
\n\n
\n异常信息如下:\n{{#payload.hits.hits}} {{_source.message}} \n \n \n{{/payload.hits.hits}} \n
",
"to": "w67307788@163.com",
"from": "lii@linccc.com"
}
},
"Webhook_f3303006-a643-42f6-a2ff-8d4066d18c3a": {
"name": "项目credit-manager日志告警",
"throttle_period": "2m",
"webhook": {
"priority": "medium",
"stateless": false,
"method": "POST",
"host": "oapi.dingtalk.com",
"port": "443",
"path": "/robot/send?access_token=token",
"body": "{\r\n \"msgtype\": \"markdown\",\r\n \"at\": {\r\n \"isAtAll\": \"True\"\r\n },\r\n \"markdown\": {\r\n \"title\": \"异常消息\",\r\n \"text\": \" credit-manager项目异常日志: \\n {{#payload.hits.hits}} {{_source.message}} \r\n \r\n{{/payload.hits.hits}}\"\r\n }\r\n}",
"params": {
"watcher": "{{watcher.title}}",
"payload_count": "{{payload.hits.total}}"
},
"headers": {
"Content-Type": "application/json"
},
"message": "credit-manager项目生产环境异常",
"use_https": true
}
}
},
"input": {
"search": {
"request": {
"index": [
"credit-manager-*"
],
"body": {
"query": {
"bool": {
"must": {
"match": {
"message": "ERROR"
}
},
"filter": {
"range": {
"@timestamp": {
"gte": "now-3m/m",
"lte": "now/m",
"format": "epoch_millis"
}
}
}
}
},
"size": 2,
"aggs": {
"dateAgg": {
"date_histogram": {
"field": "@timestamp",
"time_zone": "Asia/Shanghai",
"interval": "1m",
"min_doc_count": 1
}
}
}
}
}
}
},
"condition": {
"script": {
"script": "payload.hits.total >= 1"
}
},
"trigger": {
"schedule": {
"later": "every 1 minutes"
}
},
"disable": false,
"report": false,
"title": "credit-manager项目告警",
"wizard": {},
"save_payload": false,
"spy": false,
"impersonate": false
}
测试:
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
文章标题:kibana日志告警-创新互联
文章位置:
http://6mz.cn/article/dgcjpp.html