node_export自定义启动监控指标

发布时间 2023-07-18 17:24:13作者: ZANAN
 /usr/local/bin/node_exporter --collector.ntp --collector.supervisord --collector.supervisord.url=http://localhost:9001/RPC2 --collector.textfile.directory=/var/opt --collector.time --collector.cpu --collector.filesystem --collector.filefd --collector.loadavg --collector.meminfo --collector.stat --collector.netdev --collector.diskstats --no-collector.vmstat --no-collector.uname --no-collector.ipvs --no-collector.zfs --no-collector.xfs --no-collector.bonding --no-collector.nfs --no-collector.nfsd --no-collector.infiniband --no-collector.arp --no-collector.wifi --no-collector.bcache --no-collector.mdadm --no-collector.hwmon --no-collector.timex --no-collector.edac --no-collector.entropy --no-collector.netstat --no-collector.sockstat --no-collector.conntrack --no-collector.netclass

这是一个使用 Node Exporter 的启动命令,通过该命令配置了一系列的采集器和参数。下面对其中的选项进行解释:

--collector.ntp:启用 NTP 采集器,用于收集与网络时间协议(NTP)相关的指标。
--collector.supervisord:启用 supervisord 采集器,用于收集与 supervisord 进程管理器相关的指标。
--collector.supervisord.url=http://localhost:9001/RPC2:设置 supervisord 采集器使用的 supervisord 实例的 URL,其中 localhost:9001 是 supervisord 进程管理器的地址。
--collector.textfile.directory=/var/opt:设置 textfile 采集器的目录,该采集器用于从文件中读取指标数据。
--collector.time:启用时间指标采集器,用于收集与系统时间相关的指标。
--collector.cpu:启用 CPU 采集器,用于收集与 CPU 使用情况相关的指标。
--collector.filesystem:启用文件系统采集器,用于收集与文件系统相关的指标。
--collector.filefd:启用文件描述符采集器,用于收集与文件描述符使用情况相关的指标。
--collector.loadavg:启用平均负载采集器,用于收集与系统平均负载相关的指标。
--collector.meminfo:启用内存信息采集器,用于收集与系统内存使用情况相关的指标。
--collector.stat:启用统计信息采集器,用于收集与文件系统统计相关的指标。
--collector.netdev:启用网络接口采集器,用于收集与网络接口相关的指标。
--collector.diskstats:启用磁盘统计采集器,用于收集与磁盘 I/O 相关的指标。
--no-collector.vmstat--no-collector.uname--no-collector.ipvs 等等:禁用对应的采集器,这些选项表示不收集与 vmstat、uname、IPVS 等相关的指标。

通过使用这些选项和参数,Node Exporter 将在启动时自动启用和配置相关的采集器,以收集指定的指标数据。这些指标数据将在 /metrics 路径上暴露出来,供 Prometheus 或其他监控系统进行收集和分析。