prometheus监控windows系统

prometheus监控windows系统

本文主要介绍如何使用prometheus监控windows系统,以及在搭建监控时遇到的问题。
环境:windows



环境准备

下载prometheus

打开prometheus的官网:https://prometheus.io/ , 点击DOWNLOAD
在这里插入图片描述
选择windows的下载

下载grafana

打开grafana官网:https://grafana.com/grafana/download
在这里插入图片描述
下载window版

下载windows_exporter

打开prometheus社区:https://github.com/prometheus-community/
在这里插入图片描述
下载windows版本

一、修改配置

修改prometheus配置文件prometheus.yml,添加如下

  # winodows monitor
  - job_name: "windows_exporter"
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    static_configs:
      - targets: ["localhost:9182"]  

启动 exporter prometheus grafana

二,页面操作

1,添加prometheus数据源
在这里插入图片描述
在这里插入图片描述2,导入一个DashBoard模板
在这里插入图片描述
输入模板ID保存即可
在这里插入图片描述

三,效果展示

在这里插入图片描述

四,监控邮件提醒

1,邮箱配置smtp
在这里插入图片描述

1,修改grafana配置

[smtp]
enabled = true
host = smtp.163.com:465
user = *******@163.com
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
password = ***********
cert_file =
key_file =
skip_verify = false
from_address = *********@163.com

from_address需跟user一致

[alerting]
# Enable the legacy alerting sub-system and interface. If Unified Alerting is already enabled and you try to go back to legacy alerting, all data that is part of Unified Alerting will be deleted. When this configuration section and flag are not defined, the state is defined at runtime. See the documentation for more details.
enabled = true

# Makes it possible to turn off alert execution but alerting UI is visible
execute_alerts = true

2,添加接收邮箱
在这里插入图片描述
点击测试,如果出现错误看grafana的日志

五、注意事项

将grafana prometheus exporter的可执行文件以管理员的形式执行

参考资料

https://www.cnblogs.com/maohuidong/p/15831184.html
https://cloud.tencent.com/developer/article/1910016

  • 1
    点赞
  • 39
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值