SuperAPI AI 工具集

node-exporter

通用与其它

查看项目

更新于 10-15 23:48

技能介绍

用途:管理 Prometheus Node Exporter,采集主机 CPU、内存、磁盘、网络、文件系统、hwmon、systemd 等指标,并排查采集异常。

主要能力:查看服务状态与指标端点;统计暴露指标数量;列出启用的 collector;按类别过滤 node_cpu、node_filesystem、node_disk、node_memory、node_network、node_load、node_pressure、node_hwmon、node_systemd、node_textfile 等指标;检查监听端口与健康状态;定位常见故障,如端口 9100 连接被拒、文件系统或 hwmon 指标缺失、textfile 指标不出现、旧版指标名、打开文件数过多等。

使用方式:Debian/Ubuntu 用 apt install prometheus-node-exporter,RHEL/Fedora 用 dnf install golang-github-prometheus-node-exporter。服务单元为 prometheus-node-exporter.service(Debian/Ubuntu)或 node_exporter.service(RHEL/Fedora 手动安装)。二进制位于 /usr/bin/prometheus-node-exporter 或 /usr/local/bin/node_exporter。无配置文件,全部通过 systemd 单元中的命令行参数配置,参数位置为 /etc/default/prometheus-node-exporter 或单元覆盖中的 ExecStart=。指标端点为 http://localhost:9100/metrics。常用命令:systemctl status prometheus-node-exporter、curl -s localhost:9100/metrics | head -50、curl -s localhost:9100/metrics | grep -c '^node_'、prometheus-node-exporter --help 2>&1 | grep 'collector.'、ss -tlnp | grep 9100。

适用场景:主机指标采集、Prometheus 抓取配置、Grafana 面板与告警、自定义指标扩展、远程访问安全加固。

限制:默认无认证,暴露全部系统指标,建议绑定 --web.listen-address=127.0.0.1:9100 或加防火墙/反向代理;TLS 与 basic auth 需 v1.5+ 并通过 --web.config.file 配置。自定义指标只能通过 textfile collector 写入 .prom 文件,且需外部脚本(如 cron)生成。collector 参数为累积式,--collector.disable-defaults 后需逐个启用。v1.0 起指标名变更,旧面板与告警可能无数据。loop 设备会虚增文件系统指标,可用排除参数处理。高基数系统应禁用未用 collector。

资料未提供具体版本兼容矩阵、完整 PromQL 示例与 Grafana 面板细节。