node_exporter_installer icon indicating copy to clipboard operation
node_exporter_installer copied to clipboard

Node exporter installation script

Node exporter installation script

check

Inspired by K3s install.sh

Usage

curl -sSfL https://raw.githubusercontent.com/carlocorradini/node_exporter_installer/main/install.sh | sh -

Uninstall

$INSTALL_NODE_EXPORTER_BIN_DIR/node_exporter.uninstall.sh

Example

Enable only os collector

Note: The following commands result in the same behavior

curl ... | INSTALL_NODE_EXPORTER_EXEC="--collector.disable-defaults --collector.os" sh -s -
curl ... | INSTALL_NODE_EXPORTER_EXEC="--collector.disable-defaults" sh -s - --collector.os
curl ... | sh -s - --collector.disable-defaults --collector.os

Download a specific version without starting the service

curl ... | INSTALL_NODE_EXPORTER_VERSION="v1.5.0" INSTALL_NODE_EXPORTER_SKIP_START="true" sh -

Environment variables

Name Description Default
INSTALL_NODE_EXPORTER_SKIP_DOWNLOAD Skip downloading Node exporter. There must already be an executable binary at <BIN_DIR>/node_exporter false
INSTALL_NODE_EXPORTER_FORCE_RESTART Force restarting Node exporter service false
INSTALL_NODE_EXPORTER_SKIP_ENABLE Skip enabling Node exporter service at startup false
INSTALL_NODE_EXPORTER_SKIP_START Skip starting Node exporter service false
INSTALL_NODE_EXPORTER_SKIP_FIREWALL Skip firewall rules. Supported firewalls are firewall-cmd, ufw and iptables false
INSTALL_NODE_EXPORTER_SKIP_SELINUX Skip changing SELinux context for Node exporter binary false
INSTALL_NODE_EXPORTER_VERSION Version of Node exporter to download latest
INSTALL_NODE_EXPORTER_BIN_DIR Directory to install Node exporter binary and uninstall script /usr/local/bin or /opt/bin
INSTALL_NODE_EXPORTER_SYSTEMD_DIR Directory to install systemd service files /etc/systemd/system
INSTALL_NODE_EXPORTER_EXEC Node exporter arguments

Contributing

I would love to see your contribution :heart:

See CONTRIBUTING guidelines.

License

This project is licensed under the MIT License.
See LICENSE file for details.