// Aula 4 - Usando o Node Exporter https://prometheus.io/download/ # wget https://github.com/prometheus/node_exporter/releases/download/v1.5.0/node_exporter-1.5.0.linux-amd64.tar.gz # tar -xzf node_exporter-*linux-amd64.tar.gz # ls node_exporter-*.linux-amd64/ # cp node_exporter-*.linux-amd64/node_exporter /usr/local/bin/ # chown prometheus.prometheus /usr/local/bin/node_exporter # node_exporter # vim /etc/prometheus/prometheus.yml - job_name: node static_configs: - targets: ["localhost:9100"] !!!! TOME CUIDADO COM OS ESPAƇOS !!!!! # firewall-cmd --add-port=9100/tcp --permanent # firewall-cmd --reload # systemctl restart prometheus # systemctl status prometheus # touch /etc/systemd/system/node_exporter.service # cat > /etc/systemd/system/node_exporter.service << 'EOL' [Unit] Description=Node Exporter Prometheus Wants=network-online.target After=network-online.target [Service] User=prometheus Group=prometheus Type=simple ExecStart=/usr/local/bin/node_exporter [Install] WantedBy=multi-user.target EOL # systemctl daemon-reload # systemctl enable --now node_exporter # systemctl status node_exporter # ss -altnp | grep 9100 http://SEU_IP:9100/metrics http://SEU_IP:9090/targets process_resident_memory_bytes{job="node"} rate(node_network_receive_bytes_total[1m])