Table of contents
- download link
https://github.com/prometheus/node_exporter/releases
- start up
In order to facilitate identification, I changed its port and compiled ./start.sh
two ./stop.sh
scripts to facilitate future startup. The statement is as follows:
vim ./start.sh
nohup ./node_exporter > ./startlog.log 2>&1 &
vim ./stop.sh
#!/bin/sh
echo "stop"
#!/bin/bash
PID=$(ps -ef | grep node_exporter | grep -v grep | awk '{ print $2 }')
if [ "${PID}" ]
then
echo 'Application is stpping...'
echo kill $PID DONE
kill $PID
else
echo 'Application is already stopped...'
fi
- configure prometheus
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: "prometheus"
static_configs:
- targets: ["127.0.0.1:9090"]
#labels:
#instance: prometheus
- job_name: node_self
static_configs:
- targets: ['127.0.0.1:9100']
#labels:
#instance: node_self