1.http://192.168.1.144:9093/#/alerts 显示的告警时间是UTC时间

2.脚本的变量

{"status":"success"}[root@k8s elasticsearch]# cat vars_config.conf|egrep -v '#'
INDEX_FILE="/opt/elasticsearch/indices_file.txt"
ELASTICSEARCHDUMP_CMD="/usr/local/node-v10.16.2-linux-x64/bin/elasticdump"
OUTPUT_DIR="/data/backup/elasticsearch$(date +%Y%m%d%H%M%S)"
INPUT_DIR="/data/backup/elasticsearch$(date +%Y%m%d%H%M%S)"
BACKUP_ESURL="http://192.168.1.49:9200"
REVOVER_ESURL="http://192.168.1.144:9200"
ALERT_URL="http://192.168.1.144:9093/api/v1/alerts"
FAILALERT='[
{
"labels": {
"local_time": "bjsj",
"alertname": "esname",
"instance": "192.168.1.49",
"level": "critical..."
},
"alert": {
"startsAt": "2019-11-11 11:11:11"
},
"annotations": {
"description": "elasticsearch backup FAIL--descriptionfail"
}
}
]' SUCCESSALERT='[
{
"labels": {
"local_time": "bjsj",
"alertname": "123456ALERTname",
"instance": "192.168.1.49",
"level": "info..."
},
"alert": {
"startsAt": "2019-11-11 11:11:11"
},
"annotations": {
"description": "es backup SUCCESS--descriptionsuccess",
"summary": "es backup DONE..."
},
"startsAt": "rfcstartat",
"endsAt": "rfcendat"
}
]'

3.发送脚本

[root@k8s elasticsearch]# cat backup_es.sh|egrep -v '#'
source ./vars_config.conf
sleep
if [ ! -d "$OUTPUT_DIR" ]
then
mkdir -p "$OUTPUT_DIR"
fi
echo "$FAILALERT" > local_time.txt
for index in `cat $INDEX_FILE`
do
$ELASTICSEARCHDUMP_CMD --input=${BACKUP_ESURL}/$index --output=${OUTPUT_DIR}/${index}.map --type=mapping --limit= --concurrency=
if [[ $? -ne ]];then
curl -XPOST -d"`cat jsondata.txt`" $ALERT_URL
exit
fi
$ELASTICSEARCHDUMP_CMD --input=${BACKUP_ESURL}/$index --output=${OUTPUT_DIR}/${index}.settings --type=settings --limit= --concurrency=
if [[ $? -ne ]];then
curl -XPOST -d"`cat jsondata.txt`" $ALERT_URL
exit
fi
$ELASTICSEARCHDUMP_CMD --input=${BACKUP_ESURL}/$index --output=${OUTPUT_DIR}/${index}.data --type=data --limit= --concurrency=
if [[ $? -ne ]];then
curl -XPOST -d"`cat jsondata.txt`" $ALERT_URL
exit
fi
done echo "$SUCCESSALERT" > jsondata.txt date -d'+ 480min' --rfc-=seconds |sed 's/ /T/g' >bjsj_startat.txt
date -d'+ 481min' --rfc-=seconds |sed 's/ /T/g' >bjsj_endat.txt curl -XPOST -d"`cat jsondata.txt`" $ALERT_URL

-------------------------------------------

告警ui默认使用UTC时间

https://github.com/ABORGT/PylertAlertManager/pull/10/commits/e06f57f60325a3adb0c209b38ad1be03ce5d1868

https://prometheus.io/docs/alerting/clients/

通过调整后变成北京时间

alertmanager的web页面显示UTC时间的问题的更多相关文章

  1. web页面显示当前系统时间并定时刷新

    function showCurrentDate(){ var today,hour,second,minute,year,month,date; var strDate ; today=new Da ...

  2. javascript 实现页面显示当前时间 动态读秒

    用户进入网站后,出于友好目的,可以添加一些欢迎语句,并且显示系统当前时间,动态读秒的操作.还是直接粘贴代码吧 <script type="text/javascript"&g ...

  3. app与jvm 反向代理时config的设置(用于在web页面显示npm(就如tomcat)产生的页面)

    dev: { // Various Dev Server settings contentBase: ROOT, host: ip, port: 8084,    //此端口为任意设置,不重复即可,为 ...

  4. web页面显示折叠树菜单笔记

    zTree -- jQuery 树插件 http://pan.baidu.com/s/1skwh94h

  5. html页面显示服务器时间

    全局变量 var lblTimer; var d; ready事件里面写 lblTimer = $("#lbltimer"); d = new Date('<%=DateTi ...

  6. Web页面显示日期和动态时刻脚本

    <script language="JavaScript" type="text/JavaScript">    <!--        tm ...

  7. AlertManager 之微信告警模板,UTC时间错8个小时的解决办法

    注意事项: alertmanager中的web页面显示的报警时间是UTC时间,错8个小时,企业微信报警模板中已经修改过来了 下面配置可以作为参考: 1.prometheus操作 1.1 配置告警规则, ...

  8. 静态web页面与动态web页面的区别

    一.静态web页面 在静态web程序中,客户端使用web浏览器经过网络连接到服务器上,使用HTTP协议发起一个请求(Request),告诉服务区我现在需要得到哪个页面,所有的请求交给web服务器,之后 ...

  9. APOC官网触发器示例执行后Web页面一直转圈

    apoc使用触发器:如apoc官网指导 CREATE (d:Person {name:'Daniel'}) CREATE (l:Person {name:'Mary'}) CREATE (t:Pers ...

随机推荐

  1. [Luogu] 外星密码

    https://www.luogu.org/problemnew/show/P1928 沙比提 读清题目 #include <bits/stdc++.h> using namespace ...

  2. WebSocket浅谈

    WebSocket是HTML5开始提供的一种在单个 TCP 连接上进行全双工通讯的协议. 在WebSocket API中,浏览器和服务器只需要做一个握手的动作,然后,浏览器和服务器之间就形成了一条快速 ...

  3. C++ 结构体指针的定义

    struct node { …… } ; struct node *p1, *p2 ; typedef struct node { …… }Node; typedef Node* pNode; typ ...

  4. C++标准库分析总结(三)——<迭代器设计原则>

    本节主要总结迭代器的设计原则,以及iterstor traits的设计作用 1.迭代器遵循的原则 迭代器是算法和容器的桥梁,它是类模板的设计,迭代器必须有能力回答算法提出的问题才能去搭配该算法的使用 ...

  5. CF463E Caisa and Tree

    要是你们能和我一样看错题目意思误认为是要求互质的就舒服了. 考虑修改很少,所以修改完之后可以暴力遍历树. 那么现在问题转换成了如何求一个点的答案,直接把所有质因子存下来然后用\(set\)维护即可. ...

  6. Dockerfile 指令 WORKDIR介绍

    Dockerfile中的WORKDIR指令用于指定容器的一个目录, 容器启动时执行的命令会在该目录下执行. 相当于设置容器的工作目录了.我们来看一个dockerfile文件 #test FROM ub ...

  7. faster-rcnn CUDA8.0编译错误

    之前编译Faster-RCNN的时候用的都是CUDA7.5,最近换了机器,变成了CUDA8.0,果然编译出现错误了…… 参考下面这篇博客解决了问题: http://blog.csdn.net/kexi ...

  8. Qtcreator远程调试出现“The selected build of GDB does not support Python scripting.It cannot be used .."

      版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/aristolto/article/details/77370853 之前使用的是Qt4.7后来换 ...

  9. fcntl 函数

    设置文件的flags,阻塞设置成非阻塞,非阻塞设置成阻塞(这连个在server开发中可以封装为基本函数) 线程引入 pthread_self 和 pthread_equal 原因 ——解决不同平台的问 ...

  10. LightGBM建模

    LightGBM 1.读取csv数据并指定参数建模 # coding: utf-8 import json import lightgbm as lgb import pandas as pd fro ...