alertmanager的web页面显示UTC时间的问题
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://prometheus.io/docs/alerting/clients/
通过调整后变成北京时间
alertmanager的web页面显示UTC时间的问题的更多相关文章
- web页面显示当前系统时间并定时刷新
function showCurrentDate(){ var today,hour,second,minute,year,month,date; var strDate ; today=new Da ...
- javascript 实现页面显示当前时间 动态读秒
用户进入网站后,出于友好目的,可以添加一些欢迎语句,并且显示系统当前时间,动态读秒的操作.还是直接粘贴代码吧 <script type="text/javascript"&g ...
- app与jvm 反向代理时config的设置(用于在web页面显示npm(就如tomcat)产生的页面)
dev: { // Various Dev Server settings contentBase: ROOT, host: ip, port: 8084, //此端口为任意设置,不重复即可,为 ...
- web页面显示折叠树菜单笔记
zTree -- jQuery 树插件 http://pan.baidu.com/s/1skwh94h
- html页面显示服务器时间
全局变量 var lblTimer; var d; ready事件里面写 lblTimer = $("#lbltimer"); d = new Date('<%=DateTi ...
- Web页面显示日期和动态时刻脚本
<script language="JavaScript" type="text/JavaScript"> <!-- tm ...
- AlertManager 之微信告警模板,UTC时间错8个小时的解决办法
注意事项: alertmanager中的web页面显示的报警时间是UTC时间,错8个小时,企业微信报警模板中已经修改过来了 下面配置可以作为参考: 1.prometheus操作 1.1 配置告警规则, ...
- 静态web页面与动态web页面的区别
一.静态web页面 在静态web程序中,客户端使用web浏览器经过网络连接到服务器上,使用HTTP协议发起一个请求(Request),告诉服务区我现在需要得到哪个页面,所有的请求交给web服务器,之后 ...
- APOC官网触发器示例执行后Web页面一直转圈
apoc使用触发器:如apoc官网指导 CREATE (d:Person {name:'Daniel'}) CREATE (l:Person {name:'Mary'}) CREATE (t:Pers ...
随机推荐
- msf爆破
SSH服务口令猜解: msf > use auxiliary/scanner/ssh/ssh_loginmsf auxiliary(ssh_login) > show optionsmsf ...
- LOJ P10116 清点人数 题解
每日一题 day13 打卡 Analysis 用简单的树状数组维护单点修改和查询就行了 #include<iostream> #include<cstdio> #include ...
- Greenplum table 之 外部表
转载自: https://www.cnblogs.com/kingle-study/p/10552097.html 一.外部表介绍 Greenplum 在数据加载上有一个明显的优势,就是支持数据的并发 ...
- hud 6184
$n$ 点 $m$ 边的图求多少对三元环公用一条边变无向图为有向图 建图方法:对于每条无向边 度数小的端点向度数大的端点连边度数相同则编号小的点向编号大的点连边这样就构成 $DAG$遍历: 遍历每条边 ...
- divisors 数学
divisors 数学 给定\(m\)个不同的正整数\(a_1, a_2,\cdots, a_m\),请对\(0\)到\(m\)每一个\(k\)计算,在区间\([1, n]\)里有多少正整数是\(a\ ...
- P4092 [HEOI2016/TJOI2016]树
题目描述 在2016年,佳媛姐姐刚刚学习了树,非常开心.现在他想解决这样一个问题:给定一颗有根树(根为1),有以下两种操作: 标记操作:对某个结点打上标记(在最开始,只有结点1有标记,其他结点均无标记 ...
- (6)打造简单OS-内存分页
好长时间没有更新了,最近比较忙...... 内存分页可以放在C代码中,这样比较方便编写!即loader执行完后进入kernel_main函数之后在分配内存分页! 一.地址 讲到内存必然要讲到计算机中经 ...
- [APIO2015]八邻旁之桥——非旋转treap
题目链接: [APIO2015]八邻旁之桥 对于$k=1$的情况: 对于起点和终点在同侧的直接计入答案:对于不在同侧的,可以发现答案就是所有点坐标与桥坐标的差之和+起点与终点不在同一侧的人数. 将所有 ...
- ElasticSearch及其插件安装配置
elasticsearch安装使用 .安装步骤: 1.下载elasticsearch的rpm包: wget https://artifacts.elastic.co/downloads/elastic ...
- c++比例-libcurl多线程并发时的core【转载】
转自: https://www.cnblogs.com/edgeyang/articles/3722035.html 浅析libcurl多线程安全问题 背景:使用多线程libcurl发送请求,在未设置 ...