See the Prometheus page in the HariSekhon/Knowledge-Base repo.
make init
or
git submodule update --init --recursive
bash-tools/install/install_prometheus.sh
At root of this repo:
Also available at:
HariSekhon/Templates - prometheus.yml
wget https://raw.githubusercontent.com/HariSekhon/Templates/refs/heads/master/prometheus.yml
Run Prometheus locally from root of repo against prometheus.yml
:
bash-tools/monitoring/prometheus.sh
(automatically installs Prometheus if not already installed)
Or using Ansible (Linux only):
ansible-playbook -i localhost, ansible/prometheus/playbook.yml
Or to run it in Docker using docker-compose:
bash-tools/monitoring/prometheus_docker.sh
Open http://localhost:9090 URL to see Prometheus UI.
This script opens it using whatever the default browser on your Mac or Linux system is:
bash-tools/bin/urlopen.sh http://localhost:9090
Add exporters like the local Node Exporter the sample config is expecting using the next section.
To install an exporter, run the relevant install script from the DevOps-Bash-tools submodule:
bash-tools/install/install_prometheus_*_exporter.sh
bash-tools/install/install_prometheus_node_exporter.sh
Or using Ansible (Linux only):
ansible-playbook -i localhost, ansible/prometheus_node_exporter/playbook.yml
Run Prometheus Node Exporter locally:
bash-tools/monitoring/prometheus_node_exporter.sh
(automatically installs Node Exporter if not already installed)
Systemd unit files for running Prometheus and Node Exporter are available under systemd.
The rest of my original source repos are here.
Pre-built Docker images are available on my DockerHub.