Prometheus
Data Exporters
Node Exporter
Собирает метрики системы (загрузку цп, состояние ОП, сети дисков)
По умолчанию слушает 9100 порт.
Метрики можно получить curlom
curl http://_target_ip_:9100/metrics
system user
useradd -m -d /var/lib/monitoring -r -c "monitoring APPs" monitoring
systemd service
vim /etc/systemd/system/node_exporter.service
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target
[Service]
User=monitoring
Group=monitoring
Type=simple
ExecStartPre=/bin/bash -c 'mkdir -p /var/lib/monitoring/textfile'
ExecStart=/usr/local/bin/node_exporter \
--collector.textfile.directory=/var/lib/monitoring/textfile \
--collector.diskstats.ignored-devices="^(ram|loop|fd)\\d+$"
ExecStartPost=/bin/bash -c 'echo "node_nproc $(nproc).0" > /var/lib/monitoring/textfile/nproc.prom 2>/dev/null'
[Install]
WantedBy=multi-user.target
bin file
wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz