江西网站开发方案,wordpress的图标怎么添加,公关公司的主要业务,宝塔和wordpress提示#xff1a;文章写完后#xff0c;目录可以自动生成#xff0c;如何生成可参考右边的帮助文档 文章目录 一、普罗米修斯#xff08;Prometheus#xff09;是什么#xff1f;1.下载Prometheus工具#xff08;切记和操作系统版本对应#xff09;2.解压命令3.修改prom… 提示文章写完后目录可以自动生成如何生成可参考右边的帮助文档 文章目录 一、普罗米修斯Prometheus是什么1.下载Prometheus工具切记和操作系统版本对应2.解压命令3.修改prometheus.yml配置4.免密版默认端口90904.加密版默认端口9090 二、告警Alertmanager是什么1.下载地址2.解压命令3.修改配置文件4.配置Alertmanager启动文件默认端口9093 三、钉钉dingtalk是什么1.下载地址2.解压命令3.修改配置文件4.启动钉钉服务默认端口8060 总结 一、普罗米修斯Prometheus是什么
prometheus是由谷歌研发的一款开源的监控软件它通过安装在远程机器上的exporter通过HTTP协议从远程的机器收集数据并存储在本地的时序数据库上。目前已经被云计算本地基金会托管是继k8s托管的第二个项目号称是下一代监控。
1.下载Prometheus工具切记和操作系统版本对应
下载地址https://prometheus.io/download/
操作系统版本x86prometheus-2.45.0.linux-amd64.tar.gzlinuxprometheus-2.45.0.linux-amd64.tar.gzwindowprometheus-2.45.0.windows-amd64.zip
2.解压命令
tar -zxvf prometheus-2.45.0.linux-amd64.tar.gz3.修改prometheus.yml配置
# my global config
global:scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.# scrape_timeout is set to the global default (10s).# Alertmanager configuration 告警信息服务配置用来发送告警信息敲黑板很重要
alerting:alertmanagers:- static_configs:- targets:- 192.168.10.111:9093# Load rules once and periodically evaluate them according to the global evaluation_interval.
# 自定义规则会获取指定目录下的所有规则配置文件
rule_files:- rules/*.yml# - second_rules.yml# A scrape configuration containing exactly one endpoint to scrape:
# Here its Prometheus itself.
scrape_configs:# The job name is added as a label jobjob_name to any timeseries scraped from this config.- job_name: prometheus# metrics_path defaults to /metrics# scheme defaults to http.static_configs:- targets: [localhost:9090]- job_name: gatewaystatic_configs:- targets: [192.168.10.111:11200]- job_name: eurekastatic_configs:- targets: [192.168.10.111:11300]- job_name: objectscrape_interval: 15sscrape_timeout: 10smetrics_path: /object-library-api-service/actuator/prometheusstatic_configs:- targets: [192.168.10.111:11198]- job_name: syncstatic_configs:- targets: [192.168.10.111:11025]
# 监听服务信息定义服务名称暴露接口给普罗米修斯进行验证配置指定的gargets信息- job_name: usermetrics_path: /actuator/prometheusstatic_configs:- targets: [192.168.11.2:7777]
# - job_name: alertmanager
# static_configs:
# - targets: [192.168.10.111:9093]4.免密版默认端口9090
[Unit]
Descriptionprometheus[Service]
Restarton-failure
ExecStart/longjin/prometheus/prometheus --config.file/longjin/prometheus/prometheus.yml4.加密版默认端口9090
[Unit]
Descriptionprometheus[Service]
Restarton-failure
ExecStart/longjin/prometheus/prometheus --config.file/longjin/prometheus/prometheus.yml --web.config.file/longjin/prometheus/web.yml web.yml配置文件
basic_auth_users:# 密码生成地址:https://www.bejson.com/encrypt/bcrpyt_encode/格式为 [ admin: 123456 ]admin: $2a$10$6TUBoDndlIkyTVimXSv7COac2fC9HpT4CCA7gnwNrvTRmkA0YURWOcheck验证
二、告警Alertmanager是什么
Alertmanager 主要用于接收 Prometheus 发送的告警信息它支持丰富的告警通知渠道而且很容易做到告警信息进行去重降噪分组等是一款前卫的告警通知系统。
1.下载地址
下载地址https://prometheus.io/download/
2.解压命令
tar -zxvf alertmanager-0.26.0.linux-amd64.tar.gz3.修改配置文件
route:group_by: [alertname]group_wait: 30sgroup_interval: 5mrepeat_interval: 1hreceiver: dingding.alertname
receivers:
# 配置调用钉钉服务接口用来推送消息- name: dingding.alertnamewebhook_configs:- url: http://192.168.10.111:8060/dingtalk/alertname/sendsend_resolved: true
inhibit_rules:- source_match:severity: criticaltarget_match:severity: warningequal: [alertname, dev, instance]4.配置Alertmanager启动文件默认端口9093
[Unit]
Descriptionalertmanager[Service]
Restarton-failure
ExecStart/longjin/prometheus/alert/alertmanager --config.file/longjin/prometheus/alert/alertmanager.yml --storage.path/longjin/prometheus/alert/data/三、钉钉dingtalk是什么
钉钉(DingTalk)是阿里巴巴集团专为中国企业打造的免费沟通和协同的多端平台,提供PC版,Web版,Mac版和手机版,支持手机和电脑间文件互传。
1.下载地址
下载地址https://github.com/timonwong/prometheus-webhook-dingtalk/releases
2.解压命令
tar -zxvf prometheus-webhook-dingtalk-2.1.0.linux-amd64.tar.gz3.修改配置文件
cp一份配置文件出来切记改成你们自己钉钉机器人的配置。查看钉钉机器人基本信息就可以了
## Request timeout
timeout: 5s## Uncomment following line in order to write template from scratch (be careful!)
#no_builtin_template: true## Customizable templates path
templates:- contrib/templates/legacy/template.tmpl## You can also override default template using default_message
## The following example to use the legacy template from v0.3.0
#default_message:
# title: {{ template legacy.title . }}
# text: {{ template legacy.content . }}## Targets, previously was known as profiles
targets:alertname:url: https://oapi.dingtalk.com/robot/send?access_token0145833c0ef253ac16cf0c65284b312548a6f2b35d630400a85584b00e860e# secret for signaturesecret: SECbb5316787dc845ec6d93f36ba4b186ed642d3e9267cfd702fce8961cbe26amention:mobiles: [178****3721]webhook1:url: https://oapi.dingtalk.com/robot/send?access_token0145833c0ef253ac16cf0c65284b312548a6f2b35d630400a85584b00e860e# secret for signaturesecret: SECbb5316787dc845ec6d93f36ba4b186ed642d3e9267cfd702fce8961cbe26awebhook2:url: https://oapi.dingtalk.com/robot/send?access_token0145833c0ef253ac16cf0c65284b312548a6f2b35d630400a85584b00e860ewebhook_legacy:url: https://oapi.dingtalk.com/robot/send?access_token0145833c0ef253ac16cf0c65284b312548a6f2b35d630400a85584b00e860e# Customize template contentmessage:# Use legacy templatetitle: {{ template legacy.title . }}text: {{ template legacy.content . }}webhook_mention_all:url: https://oapi.dingtalk.com/robot/send?access_token0145833c0ef253ac16cf0c65284b312548a6f2b35d630400a85584b00e860esecret: SECbb5316787dc845ec6d93f36ba4b186ed642d3e9267cfd702fce8961cbe26amention:all: truewebhook_mention_users:url: https://oapi.dingtalk.com/robot/send?access_token0145833c0ef253ac16cf0c65284b312548a6f2b35d630400a85584b00e860emention:mobiles: [178****3721]4.启动钉钉服务默认端口8060
[Unit]
Descriptiondingtalk[Service]
Restarton-failure
WorkingDirectory/longjin/prometheus/dingtalk
ExecStart/longjin/prometheus/dingtalk/prometheus-webhook-dingtalk --config.file/longjin/prometheus/dingtalk/config.yml
[Install]
WantedBymulti-user.target总结
人生物语自己不努力上进何来的得心应手不是娇靥就可以有馥郁的芳香不是有刀戟就可以百战百胜。你不是急流不能湍飞你不是花儿你没有自带的芳香你不是海洋不可海纳百川。