Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
prometheus_new_host [2021/07/26 22:51]
warmachine created
prometheus_new_host [2022/01/18 20:09] (current)
warmachine
Line 1: Line 1:
-**note:** this requires you already have a monitoring server with grafan/prometheus/node exporter setup. this is simply adding new VMs to monitoring and automating the agent install on the host itself.\\+<color red>**note:** this requires you already have a monitoring server with grafana/prometheus/node exporter setup. this is simply adding new VMs to monitoring and automating the agent install on the host itself. </color>\\
 \\ \\
 +ssh to new host\\
 +\\
 +create new bash script using bash script note (see below)\\
 +\\
 +ssh to monitoring host (192.168.1.48) \\
 +\\
 +nano /etc/prometheus/prometheus.yml\\
 +\\
 +add ip at bottom of file, save\\
 +\\
 +sudo systemctl restart prometheus\\
 +\\
 +check graphana dash\\
 +\\
 +192.168.1.48:3000   login/password\\
 +\\
 +192.168.1.48:9090/targets
 +
 +**script:**
 +\\
 +nano prom.sh, copy paste the following, save, then bash prom.sh
 +<code>#!/bin/bash
 +
 +cd /tmp
 +
 +sudo apt-get update
 +
 +sudo apt-get install curl -y
 +
 +curl -LO https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
 +
 +tar -xvf node_exporter-0.18.1.linux-amd64.tar.gz
 +
 +rm node_exporter-0.18.1.linux-amd64.tar.gz
 +
 +sudo mv node_exporter-0.18.1.linux-amd64/node_exporter /usr/local/bin/
 +
 +sudo useradd -rs /bin/false node_exporter
 +
 +echo "[Unit]
 +Description=Node Exporter
 +After=network.target
 + 
 +[Service]
 +User=node_exporter
 +Group=node_exporter
 +Type=simple
 +ExecStart=/usr/local/bin/node_exporter
 + 
 +[Install]
 +WantedBy=multi-user.target" > /etc/systemd/system/node_exporter.service
 +
 +sudo systemctl daemon-reload
 +sudo systemctl start node_exporter
 +sudo systemctl status node_exporter
 +sudo systemctl enable node_exporter
 +</code>
 +
 +
 +
  
Last modified: le 2021/07/26 22:51