随笔分类 - Python自动化运维
利用Python进行自动化运维
摘要:密码是采用bcrypt加密 创建web.yml配置文件 basic_auth_users: # 密码生成地址:https://www.bejson.com/encrypt/bcrpyt_encode/,格式为 [ 用户名:密码 ] admin: 10$wUvMZwoFs4/PFTZAAysA
阅读全文
摘要:拉取镜像 [root@VM-24-9-centos ~]# docker pull prom/pushgateway Using default tag: latest latest: Pulling from prom/pushgateway 22b70bddd3ac: Pull complete
阅读全文
摘要:## 拉取镜像 ``` docker pull prom/prometheus:latest ``` ## 创建网络 (可不用) ``` # 方便其他组件连接Prometheus docker network create prom-network --driver bridge ``` ## 持久
阅读全文
摘要:环境 windows 10 pushgateway prometheus 问题 启动pushgateway及Prometheus后,通过curl往pushgateway推送数据出现以下问题 C:\Users\Jruing>echo 'cpu 2' | curl --data-binary @- ht
阅读全文
摘要:Blackbox Exporter是Prometheus社区提供的官方黑盒监控解决方案,其允许用户通过:HTTP、HTTPS、DNS、TCP以及ICMP 的方式对网络进行探测。我们可以利用这个exporter定时访问业务系统某个接口来确定服务是否存活 下载 [root@VM-24-9-centos
阅读全文
摘要:docker安装google/cadvisor [root@VM-24-9-centos ~]# docker pull google/cadvisor Using default tag: latest latest: Pulling from google/cadvisor ff3a5c916c
阅读全文
摘要:Grafana官网 下载Grafana [root@VM-24-9-centos Prometheus_server]# wget https://dl.grafana.com/oss/release/grafana-9.3.2.linux-amd64.tar.gz 安装Grafana [root@
阅读全文
摘要:Node_exporter是可以在* Nix和Linux系统上运行的计算机度量标准的导出器。 Node_exporter 主要用于暴露 metrics 给 Prometheus,其中 metrics 包括:cpu 的负载,内存的使用情况,网络等。 配置文件 修改主配置文件 [root@VM-24-9
阅读全文
摘要:全局配置注解 global: # 默认情况抓取目标的频率,默认1分钟 [ scrape_interval: <duration> | default = 1m ] # 抓取请求超时的时间,默认10S [ scrape_timeout: <duration> | default = 10s ] # 评
阅读全文
摘要:一般一个job作为一个业务服务,它下面的监控的机器/节点都是这个服务的节点,为了方便管理,我们可以按照job划分,为每个job创建一个子配置文件,这样方便管理 配置文件 # my global config global: scrape_interval: 15s # #每15s采集一次数据 eva
阅读全文
摘要:Label Lable是为了方便管理及查询监控目标,在后续写promtheus查询语法的时候需要使用标签作为查询条件 配置文件 # A scrape configuration containing exactly one endpoint to scrape: # Here it's Promet
阅读全文
摘要:官网 https://prometheus.io/docs/introduction/overview/ 下载Prometheus https://prometheus.io/download/ 安装Prometheus 配置文件 # my global config global: scrape_
阅读全文
摘要:检查是否开放管理API 检查Prometheus启动时是否增加参数 web.enable-amdin-api,该参数必须指定 标记指标及时间范围内要删除数据 标记待删除数据api:POST http://127.0.0.1:9090/api/v1/admin/tsdb/delete_series?m
阅读全文
摘要:消息通知方式 本人使用场景主要用于服务器告警通知,爬虫结果通知... 钉钉 官方文档 飞书 官方文档 企业微信 官方文档 wxpusher(微信) 官方文档 邮件 电话 短信 阿里云文档 腾讯云文档 pushplus(多平台) 官方文档 Server酱(多平台) 官方文档
阅读全文
摘要:Celery + Ansible 执行任务无返回值 在@app.task修饰的方法中加入 from multiprocessing import current_process current_process()._config={"semprefix":"/mp"} 栗子 @app.task de
阅读全文