1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
cat > run_node_exporter.sh << 'EOF'
docker stop node_exporter
docker rm node_exporter
docker run -d --name node_exporter \
--restart=always \
--net="host" \
--pid="host" \
-v "/proc:/host/proc:ro" \
-v "/sys:/host/sys:ro" \
-v "/:/rootfs:ro" \
prom/node-exporter \
--path.procfs=/host/proc \
--path.rootfs=/rootfs \
--path.sysfs=/host/sys \
--collector.filesystem.ignored-mount-points='^/(sys|proc|dev|host|etc)($$|/)'
EOF
sh run_node_exporter.sh