Monitoring Stack Installation on buzz.deome.loc
Monitoring Stack Installation on buzz.deome.loc
Overview
This guide details the installation and configuration of a monitoring stack on buzz.deome.loc using Node Exporter, Prometheus, and Grafana. This setup will allow for system metrics collection, visualization, and alerting.
1. Node Exporter Installation (for System Metrics)
-
Download and Install Node Exporter:
- Navigate to the desired installation directory and download the latest Node Exporter release:
cd /usr/local/bin wget https://github.com/prometheus/node_exporter/releases/download/v1.6.0/node_exporter-1.6.0.linux-amd64.tar.gz tar xvfz node_exporter-1.6.0.linux-amd64.tar.gz mv node_exporter-1.6.0.linux-amd64/node_exporter . rm -rf node_exporter-1.6.0.linux-amd64*
- Navigate to the desired installation directory and download the latest Node Exporter release:
-
Create a Systemd Service for Node Exporter:
- Create a new service file:
sudo nano /etc/systemd/system/node_exporter.service - Add the following configuration:
[Unit] Description=Node Exporter After=network.target [Service] User=node_exporter ExecStart=/usr/local/bin/node_exporter [Install] WantedBy=default.target
- Create a new service file:
-
Start and Enable Node Exporter:
- Enable and start Node Exporter:
sudo systemctl daemon-reload sudo systemctl enable node_exporter sudo systemctl start node_exporter
- Enable and start Node Exporter:
-
Verify Node Exporter:
- Node Exporter should now be running on port
9100. Check by navigating tohttp://buzz.deome.loc:9100/metricsin a web browser.
- Node Exporter should now be running on port
2. Prometheus Installation and Configuration
-
Download and Install Prometheus:
- Download the latest Prometheus release:
cd /usr/local/bin wget https://github.com/prometheus/prometheus/releases/download/v2.47.0/prometheus-2.47.0.linux-amd64.tar.gz tar xvfz prometheus-2.47.0.linux-amd64.tar.gz mv prometheus-2.47.0.linux-amd64/prometheus . mv prometheus-2.47.0.linux-amd64/promtool . rm -rf prometheus-2.47.0.linux-amd64*
- Download the latest Prometheus release:
-
Configure Prometheus:
- Create the configuration file:
sudo nano /usr/local/bin/prometheus.yml - Add the following configuration:
global: scrape_interval: 15s scrape_configs: - job_name: 'node_exporter' static_configs: - targets: ['localhost:9100']
- Create the configuration file:
-
Create a Systemd Service for Prometheus:
- Create a new service file:
sudo nano /etc/systemd/system/prometheus.service - Add the following configuration:
[Unit] Description=Prometheus After=network.target [Service] User=prometheus ExecStart=/usr/local/bin/prometheus --config.file=/usr/local/bin/prometheus.yml --storage.tsdb.path=/var/lib/prometheus [Install] WantedBy=default.target
- Create a new service file:
-
Start and Enable Prometheus:
- Enable and start Prometheus:
sudo systemctl daemon-reload sudo systemctl enable prometheus sudo systemctl start prometheus
- Enable and start Prometheus:
-
Verify Prometheus:
- Access Prometheus at
http://buzz.deome.loc:9090.
- Access Prometheus at
3. Grafana Installation and Configuration
-
Install Grafana:
- Add the Grafana repository and install Grafana:
sudo apt update sudo apt install -y software-properties-common sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main" sudo apt update sudo apt install grafana -y
- Add the Grafana repository and install Grafana:
-
Start and Enable Grafana:
- Enable and start Grafana:
sudo systemctl start grafana-server sudo systemctl enable grafana-server
- Enable and start Grafana:
-
Access Grafana:
- Grafana will be accessible at
http://buzz.deome.loc:3000. Default login isadmin/admin(you will be prompted to change the password upon first login).
- Grafana will be accessible at
-
Add Prometheus Data Source in Grafana:
- In Grafana:
- Go to Configuration > Data Sources > Add Data Source.
- Select Prometheus and set the URL to
http://localhost:9090. - Save and test the data source.
- In Grafana:
4. Setting Up Basic Dashboards and Alerts
-
Import Node Exporter Dashboard:
- Grafana provides pre-made dashboards. For Node Exporter metrics, import dashboard ID
1860from Grafana’s dashboard library:- Go to Create > Import in Grafana.
- Enter
1860and follow the prompts to import the Node Exporter dashboard.
- Grafana provides pre-made dashboards. For Node Exporter metrics, import dashboard ID
-
Create Alerts in Prometheus (Optional):
- Alerts can be set up in Prometheus for key metrics (e.g., CPU usage, memory).
- Edit the Prometheus configuration file to add alert rules, and restart Prometheus for changes to take effect.
5. Maintenance and Updates
-
Update the Stack:
- Periodically check for updates to Node Exporter, Prometheus, and Grafana:
sudo apt update && sudo apt upgrade -y
- Periodically check for updates to Node Exporter, Prometheus, and Grafana:
-
Data Backup:
- Regularly back up Grafana dashboards and Prometheus data as needed.
This setup guide provides a full configuration for a monitoring stack on buzz.deome.loc using Node Exporter, Prometheus, and Grafana. Let me know if there are additional steps or customizations you’d like!
No Comments