---
# System prepended metadata

title: Monitoring Tools Virtual Machine

---


## Prometheus
Guidance of setup installation at Ubuntu VM

### User Add Permission
```
sudo useradd --no-create-home --shell /bin/false prometheus
```
### Create Directory
```
sudo mkdir /etc/prometheus
```
```
sudo mkdir /var/lib/prometheus
```

### Change Group Ownership (chown)
```
sudo chown prometheus:prometheus /etc/prometheus
sudo chown prometheus:prometheus /var/lib/prometheus
```
### Download Prometheus
```
sudo wget https://github.com/prometheus/prometheus/releases/download/v2.44.0/prometheus-2.44.0.linux-amd64.tar.gz
```

`sudo tar -xzvf prometheus-2.44.0.linux-amd64.tar.gz`


### Copy folder
```
sudo cp prometheus-2.44.0.linux-amd64/prometheus /usr/local/bin/
```

`sudo cp prometheus-2.44.0.linux-amd64/promtool /usr/local/bin/`

### Set user and group ownership folder 
```
sudo chown -R prometheus:prometheus /etc/prometheus/consoles
```

`sudo chown -R prometheus:prometheus /etc/prometheus/console_libraries`

### Configure Prometheus
Configure Prometheus yml:
`nano /etc/prometheus/prometheus.yml`

```
global:
  scrape_interval: 15s
scrape_configs:
  - job_name: 'prometheus'
    scrape_interval: 5s
    static_configs:
      - targets: ['localhost:9090']
  - job_name: 'node_exporter'
    scrape_interval: 5s
    static_configs:
      - targets: ['node_exporter_1:1322','node_exporter_2:1322']
```
Change group of ownership
`sudo chown prometheus:prometheus /etc/prometheus/prometheus.yml`

Run Prometheus
```
sudo systemctl restart prometheus
sudo systemctl status prometheus
```

## Node Exporter
```
sudo useradd --no-create-home --shell /bin/false node_exporter
```

```
sudo wget https://github.com/prometheus/node_exporter/releases/download/v1.6.0/node_exporter-1.6.0.linux-amd64.tar.gz
```

`sudo tar -xzvf node_exporter-1.6.0.linux-amd64.tar.gz`

```
sudo cp node_exporter-1.6.0.linux-amd64/node_exporter /usr/local/bin/
```

`sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter`

```
sudo nano /etc/systemd/system/node_exporter.service
```

```
[Unit]
Description=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 --web.listen-address=:1322

[Install]
WantedBy=multi-user.target  
```
ctrl+c and finish

```
sudo systemctl restart node_exporter
```
```
sudo systemctl status node_exporter
```
