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 ...
随机推荐
- /etc/crontab
- Gym - 101981E 思维
Gym - 101981EEva and Euro coins 题意:给你两个长度皆为n的01串s和t,能做的操作是把连续k个相同的字符反转过来,问s串能不能变成t串. 一开始把相同的漏看了,便以为是 ...
- linux系列(十八):locate命令
1.命令格式: locate [选择参数] [样式] 2.命令功能: locate指令和find找寻档案的功能类似,但locate是透过update程序将硬盘中的所有档案和目录资料先建立一个索引数据库 ...
- PHP全栈学习笔记30
变量:整型(int) 浮点(float).布尔(bool).字符串(string) 混合类型: 数组(array).对象(object) 特殊类型:空(null). 资源(resouce).回调(ca ...
- Ubuntu上配置vtk开发环境——基于visual studio code 与 gcc
环境说明 vtk版本7.1.1 visual studio 1.16.1 Ubuntu 16.04 + 自带的gcc 编译过程与windows下类似还好,运行自己的代码开始面对cmake与make的各 ...
- (转)centos7安装telnet服务
借鉴:https://www.cnblogs.com/daipenglin/p/4934572.html 阅读目录 1 CentOS7.0 telnet-server 启动的问题 场景:在进行Teln ...
- Linux用户组
1.介绍 类似于角色,系统可以对有共性的多个用户进行统一的管理 2.增加组 groupadd 组名 3.删除组 groupdel 组名 4.增加用户时直接为用户指定组 useradd -g 用 ...
- html5、手机端 input 单独打开相机、摄像头、录音功能
相机:<input type="file" name="image" accept="image/*" capture="u ...
- zsh: no matches found
具体原因: 因为zsh缺省情况下始终自己解释这个 *.h,而不会传递给 find 来解释. 解决办法: 在~/.zshrc中加入: setopt no_nomatch, 然后进行source .zsh ...
- phpstorm有红波浪线,怎么找到语法错误的地方
在phpstorm里面,有时候不小心多打了个字符,会导致IDE显示红色波浪线,提示有语法错误了,但是不容易找出在哪一行. 在有红色波浪线的文件上,右键[inspect code]: 检查代码后就会知道 ...