前言

The node_exporter is designed to monitor the host system. It’s not recommended to deploy it as a Docker container because it requires access to the host system.

For situations where Docker deployment is needed, some extra flags must be used to allow the node_exporter access to the host namespaces.

如上所述:node-exporter 是监控主机的,必须访问主机系统,不建议以 docker 容器方式部署。若在某些情况下必须以 docker 容器方式部署 node-exporter,balabala….

需要额外添加的参数 github.com/prometheus/node_exporter README 中有详细说明。另外,一般都直接使用 prometheus 社区提供的 helm chart 包部署,里面默认开启了需要的选项。

监控—服务器时钟

node-exporter 中监控服务器时钟的 collector 是 timex 。社区的 chart 包中,默认就有相关的告警规则:
(1) 服务器时钟偏差:
image.png
(2) ntp 时钟同步未开启 & 时钟偏差大于 16s:
image.png

(1) 手动同步时钟之后,告警未消除

描述:prometheus 触发告警 NodeClockNotSynchronising :
① 手动同步时钟之后,告警未消除;
② 部署 ntp 服务,启动 ntpd,告警仍未消除;
③ 基于上一步,重启 ntpd 服务,告警恢复。

解释:https://serverfault.com/questions/1043358/prometheus-alerting-on-nodeclocknotsynchronising-for-vms