sudo apt update
sudo apt install -y prometheus prometheus-node-exporter
sudo systemctl enable --now prometheus prometheus-node-exporter

sudo apt install -y apt-transport-https software-properties-common wget gpg
sudo mkdir -p /etc/apt/keyrings
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
sudo apt update
sudo apt install -y grafana
sudo systemctl enable --now grafana-server

sudo apt install -y apache2-utils stress-ng apache2 curl
sudo systemctl enable --now apache2   

sudo cat /etc/prometheus/prometheus.yml
# it must contain something like:
#   scrape_configs:
#     - job_name: node
#       static_configs:
#         - targets: ['localhost:9100']
# if "node" is missing, add it under scrape_configs, then:
sudo promtool check config /etc/prometheus/prometheus.yml
sudo systemctl restart prometheus

systemctl status prometheus prometheus-node-exporter grafana-server --no-pager | grep -E "●|Active"