Skip to content

HariSekhon/Prometheus

Repository files navigation

Hari Sekhon - Prometheus

GitHub starsGitHub forksLines of CodeLicenseMy LinkedInGitHub Last Commit

Codacy BadgeCodeFactorQuality Gate StatusMaintainability RatingReliability RatingSecurity Rating

PythonLinuxMac

Mac HomebrewAlpineCentOSDebianFedoraRedhatRockyUbuntu

CI Builds OverviewAzure DevOps PipelineGitLab PipelineBitBucket Pipeline

Repo on GitHubRepo on GitLabRepo on Azure DevOpsRepo on BitBucket

ValidationKicsGrypeSemgrepSemgrep CloudSonarCloudSystemd-Analyze VerifyTrivyYAML

Quick Prometheus Doc

See the Prometheus page in the HariSekhon/Knowledge-Base repo.

Prometheus Management Code

Initialize DevOps-Bash-tools and Template git submodules

make init

or

git submodule update --init --recursive

Prometheus

Install Prometheus

bash-tools/install/install_prometheus.sh

Sample Config from HariSekhon/Templates

At root of this repo:

prometheus.yml

Also available at:

HariSekhon/Templates - prometheus.yml

wget https://raw.githubusercontent.com/HariSekhon/Templates/refs/heads/master/prometheus.yml

Run Prometheus

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.

Prometheus Exporters

Install Scripts

To install an exporter, run the relevant install script from the DevOps-Bash-tools submodule:

bash-tools/install/install_prometheus_*_exporter.sh 

Install Node Exporter

bash-tools/install/install_prometheus_node_exporter.sh

Or using Ansible (Linux only):

ansible-playbook -i localhost, ansible/prometheus_node_exporter/playbook.yml

Run Node Exporter

Run Prometheus Node Exporter locally:

bash-tools/monitoring/prometheus_node_exporter.sh

(automatically installs Node Exporter if not already installed)

Systemd Unit Files

Systemd unit files for running Prometheus and Node Exporter are available under systemd.

More Core Repos

Knowledge

Readme CardReadme Card

DevOps Code

Readme CardReadme CardReadme CardReadme Card

Containerization

Readme CardReadme Card

CI/CD

Readme CardReadme Card

DBA - SQL

Readme Card

DevOps Reloaded

Readme CardReadme CardReadme CardReadme CardReadme Card

Templates

Readme CardReadme Card

Misc

Readme CardReadme Card

The rest of my original source repos are here.

Pre-built Docker images are available on my DockerHub.

About

Prometheus deployment / management code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published