Run node_exporter prometheus with supervisor
1. Install supervisor
apt-get install supervisor -y
2. Configure service node_exporter with supervisor
2.1 Get node_exporter
cd /opt/ wget https://github.com/prometheus/node_exporter/releases/download/v0.15.2/node_exporter-0.15.2.linux-amd64.tar.gz tar -xvf node_exporter-0.15.2.linux-amd64.tar.gz
2.2 Create supervisor config
mkdir -p /etc/supervisor/conf.d/ nano /etc/supervisor/conf.d/node_exporter.conf
2.3 Past text in file
[supervisord] nodaemon=true environment=HOME="/usr/bin/" [program:node_exporter] command=/opt/node_exporter-0.15.2.linux-amd64/node_exporter --web.listen-address=:9100 autostart=true autorestart=true startretries=3 stderr_logfile=/var/log/node_exporter.err.log stdout_logfile=/var/log/node_exporter.out.log user=root
2.4 Update configs
service supervisor start supervisorctl reread supervisorctl update
2.5 Test
curl http://127.0.0.1:9100/metrics
Profit!!!!