Skip to content

Instantly share code, notes, and snippets.

@iwittkau
Created June 16, 2020 16:24
Show Gist options
  • Save iwittkau/95249e95a4e825f824594be7e677bedc to your computer and use it in GitHub Desktop.
Save iwittkau/95249e95a4e825f824594be7e677bedc to your computer and use it in GitHub Desktop.
#!/bin/bash
VERSION="1.0.1.linux-armv7"
wget https://github.com/prometheus/node_exporter/releases/download/v1.0.1/node_exporter-$VERSION.tar.gz
wget https://raw.githubusercontent.com/prometheus/node_exporter/master/examples/systemd/node_exporter.service
wget https://raw.githubusercontent.com/prometheus/node_exporter/master/examples/systemd/sysconfig.node_exporter
tar xvfz node_exporter-$VERSION.tar.gz
useradd -r node_exporter
mkdir -p /etc/sysconfig
mkdir -p /var/lib/node_exporter/textfile_collector
chown -R node_exporter /var/lib/node_exporter/textfile_collector
chgrp -R node_exporter /var/lib/node_exporter/textfile_collector
cp node_exporter-1.0.1.linux-armv7/node_exporter /usr/sbin/node_exporter
cp sysconfig.node_exporter /etc/sysconfig/node_exporter
cp node_exporter.service /etc/systemd/system/
systemctl enable node_exporter.service
systemctl start node_exporter.service
systemctl status node_exporter.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment