Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Collecting Linux Server Metrics with Prometheus

Prometheus uses a pull model to periodically scrape metric data from targets. In order to collect data, you will need to set up an entity that is able to provide metric data, and then configure the Prometheus server to scrape it. In this lab, you will walk through the process of configuring Prometheus monitoring for a Linux server.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 06, 2025
Duration
45m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Install and Configure Node Exporter on the LimeDrop Web Server
    1. Log in to the LimeDrop web server to perform the following steps.

    2. Create a user and group that will be used to run Node Exporter:

      sudo useradd -M -r -s /bin/false node_exporter
      
    3. Download and extract the Node Exporter binary:

      wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
      
      tar xvfz node_exporter-0.18.1.linux-amd64.tar.gz
      
    4. Copy the Node Exporter binary to the appropriate location and set ownership:

      sudo cp node_exporter-0.18.1.linux-amd64/node_exporter /usr/local/bin/
      
      sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter
      
    5. Create a systemd unit file for Node Exporter:

      sudo vi /etc/systemd/system/node_exporter.service
      
    6. Define the Node Exporter service in the unit file:

      [Unit]
      Description=Prometheus Node Exporter
      Wants=network-online.target
      After=network-online.target
      
      [Service]
      User=node_exporter
      Group=node_exporter
      Type=simple
      ExecStart=/usr/local/bin/node_exporter
      
      [Install]
      WantedBy=multi-user.target
      
    7. Start and enable the service:

      sudo systemctl daemon-reload
      
      sudo systemctl start node_exporter
      
      sudo systemctl enable node_exporter
      
    8. Test that your Node Exporter is working by making a request to it from localhost. You should get some metric data on the screen in response to this request:

      curl localhost:9100/metrics
      
  2. Challenge

    Configure Prometheus to Scrape Metrics from the LimeDrop Web Server
    1. Log in to the Prometheus server to perform the following steps.

    2. Edit the Prometheus config file:

      sudo vi /etc/prometheus/prometheus.yml
      
    3. Locate the scrape_configs section and add a new entry under that section:

      ...
      
        - job_name: 'LimeDrop Web Server'
          static_configs:
          - targets: ['10.0.1.102:9100']
      
      ...
      
    4. Restart Prometheus to load the new config:

      sudo systemctl restart prometheus
      
    5. Navigate to the Prometheus expression browser in your web browser using the public IP address of your Prometheus server: <PROMETHEUS_SERVER_PUBLIC_IP>:9090.

    6. Run the following query to verify you are able to get some metric data from the LimeDrop web server:

      node_filesystem_avail_bytes{job="LimeDrop Web Server"}
      
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight