Skip to content

Ercan Ermis

notes for everyone

Menu
  • Cloud
    • Amazon Web Services
    • Google Cloud Platform
  • Linux
  • DevOps
  • Docker
  • Uncategorized
  • Contact Me
Menu

How to Install Node Exporter on Linux Server

Posted on May 10, 2021May 17, 2021 by Ercan

Node Exporter is a Prometheus exporter for server level and OS level metrics with configurable metric collectors. It helps us in measuring various server resources such as RAM, disk space, and CPU utilization. Node exporter is a good solution to collect all the Linux server-related metrics and statistics for monitoring.

Before Start

  • Prometheus Server
    After node exporter installation, you should send your metrics to the Prometheus server.
  • Sudo Privileges
    You should access your server via SSH with root or your ssh login user should have root privileges with sudo.

Node Exporter Installation Steps

  1. Create a directory

    I prefer to use /opt/node-exporter path for installation. You can also use.

  2. Add user

    You can add a user with a simple command. It’s:
    adduser -r -d /opt/node-exporter node-exporter -s /sbin/nologin

  3. Download the binary

    Download the binary from https://github.com/prometheus/node_exporter/releases page and extract the files to /opt/node-exporter path directly.

  4. Change Owner and Group Permissions

    Now, need to set user permissions to execute node_exporter binary.
    chown -R node-exporter:node-exporter /opt/node-exporter

  5. Create a systemd service file

    We should manage this service status with systemd. Now, time to create a systemd service file. The file path should /etc/systemd/system/node-exporter.service You can paste all configurations below into it.

    [Unit]
    Description=Prometheus exporter for machine metrics
    Documentation=https://github.com/flightlesstux/node_exporter

    [Service]
    Restart=always
    User=node-exporter
    Gorup=node-exporter
    ExecStart=/opt/node-exporter/node_exporter
    ExecReload=/bin/kill -HUP $MAINPID
    TimeoutStopSec=20s
    SendSIGKILL=no

    [Install]
    WantedBy=multi-user.target


  6. Start the node-exporter

    Now, you can ready to start your node-exporter service with systemctl start node-exporter command.

Now, you can see your servers metrics via http://IP_ADDRESS:9100/metrics url. If you can’t reach the page, you should check your firewall and/or security group settings to allow TCP 9100.

Bonus

Now, you now the steps and what you need for install Node Exporter. I turned this installation to automation and you can feel free to use. Just run the command sh <(curl https://raw.githubusercontent.com/flightlesstux/node_exporter/master/installer.sh) and in a few seconds, your node-exporter will be installed.

GitHub Repository: https://github.com/flightlesstux/node_exporter

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • SSL CA Problem on CentOS7 Docker and Solution
  • What do I have?
  • I’m officially AWS Community Builder!
  • Deploy HA nginx to AWS ECS with Geolocation Routing via Terraform
  • Deploy nginx docker to AWS ECS with Terraform Automation
  • How to Install Node Exporter on Linux Server
  • FortiClient Problem on M1 MacBookPro Problem Solution
  • Connect your AWS to GCP with Terraform via IPSec Site-to-Site VPN
  • Google Cloud Platform Automation with Terraform Easily
  • How to secure your Amazon Web Services account
  • Install UGREEN USB Ethernet Adapter on macOS
  • Redirect 301 HTTPS on App Engine with nginx on Google Cloud Platform
  • Set two different Target Groups on AWS Load Balancer with Terraform
  • Extend your ec2 Linux disk without reboot on Amazon Web Services
  • Create a New Grant User on AWS RDS (MariaDB)
  • Amazon S3 CORS Settings with CloudFront on Amazon Web Services
  • Take your GitLab backup everyday if it works in Docker
  • Find large files in CentOS, ubuntu and MacOS easily
  • Fix “Error: rpmdb open failed” on CentOS or Amazon Linux 2
  • Error: No space left on the device when starting/stopping services only
  • Juniper SRX110H-VA VDSL2 Configuration Step by Step
  • Enable Logrotation for Docker Containers
  • Download specific file extension via wget easily on terminal
  • Find the exact size of certain files in Linux via terminal
  • Disable SELinux on CentOS 7 or CentOS 8
  • Hello Blog!

Tag Cloud

amazon linux 2 amazon web services automation aws aws community builder bug centos ci/cd cloud community connection container curl devops docker ec2 ecs fargate file size forticlient fortigate gcp gitlab google cloud platform ipsec isp juniper linux m1 macbookpro macos multi region network pipeline reliability route table security terraform turknet ubuntu vdsl2 vpn vpn problem vpn tunnel wget yum

Archive

  • March 2022 (1)
  • July 2021 (1)
  • May 2021 (6)
  • April 2021 (5)
  • February 2021 (1)
  • January 2021 (1)
  • September 2020 (2)
  • July 2020 (1)
  • April 2020 (1)
  • March 2020 (1)
  • February 2020 (1)
  • November 2019 (5)
©2022 Ercan Ermis | Built using WordPress and Responsive Blogily theme by Superb