Monitoring Instance with Prometheus and Grafana

Prometheus section
  1. Login to the server with root access.
  2. Update and upgrade system : yum -y update; yum -y upgrade
  3. Download and Install Prometheus :
    - [[email protected]]# wget 
    - [[email protected]]# tar xvfz prometheus-2.92.linux-amd64.tar.gz
    - [[email protected]]# mv prometheus-2.92.linux-amd64 prometheus
    - [[email protected]]# cd prometheus
    - [[email protected]]# cat prometheus.yaml #basic configuration

  4. Start prometheus service : ./prometheus --config.file=prometheus.yml
  5. Open firewall tcp port 9090
Client Section, monitoring other Linux machine
  1. Login to the client machine

  2. Download, extract, and running the node exporter

    [[email protected]]# wget
    [[email protected]]# tar xzvf node_exporter-0.17.0.linux-amd64.tar.gz
    [[email protected]]# mv node_exporter-0.17.0.linux-amd64.tar.gz node_exporter
    [[email protected]]# cd node_exporter
    [[email protected]]# ./node_exporter
  3. Set node_exporter as a service

    #reference : 
    [[email protected]]# cp node_exporter /usr/local/bin
    [[email protected]]# useradd -rs /bin/false node_exporter
    [[email protected]]# cat > /etc/systemd/system/node_exporter.service

    Description=Node Exporter



  4. Start daemon, node_exporter and enable autostart

    [[email protected]]# systemctl daemon-reload
    [[email protected]]# systemctl start node_exporter
    [[email protected]]# systemctl status node_exporter
    [[email protected]]# systemctl enable node_exporter
  5. Open firewall port 9100

  6. Make sure you can access node exporter metric via http://:9100/metrics

Prometheus section 2.0
  1. Login to the server with root access.
  2. CD to Prometheus directory
  3. Re-configure prometheus.yaml, add client scrape_configs
  4. Restart Prometheus service : ./prometheus --config.file=prometheus.yml
  5. Send Prometheus service to the background : ctrl +z and then bg
  6. Make sure client node_exporter status is active on Prometheus > Status > Targets
Grafana section (same server with prometheus)
  1. Login to the machine with root access
  2. Install grafana with yum : yum install
  3. Start grafana service
    [[email protected]]# systemctl start grafana-server
    [[email protected]]# systemctl enable grafana-server
  4. Open firewall tcp port 3000
  5. Access Grafana dashboard on the browser : http://ip-address:3000
  6. Create Prometheus datasource (
  7. Import dashboard template for monitoring linux machine with Prometheus, you can download the json file from this url :