Installing prometheus On Centos6/Centos7

Prometheus is an open-source systems monitoring and alerting toolkit, which was released in 2012. It is considered as a better alternative for popular Graphite tool.

In this article i will explain how to install prometheus on a Centos server and collects system metrics

First you have to download the binaries from https://prometheus.io/download/ . You can chose the binaries suitable for your system

For Centos 64 bit,

Now you can configure it . Prometheus collects metrics from monitored targets by scraping metrics HTTP endpoints on these targets. All the definitions goes to a file prometheus.yml . Sample configuration is below

In prometheus.yml file, under scrape_configs you can see the hosts from which prometheus pull the metrics. For now, we have added localhost

You can start prometheus using following command

You can run it on screen or background. If there are no errors, you should be able to access the prometheus web interface at

Now we will download “Node exporter”, which is used to collect the system metrics

You can start it using

It will start listening on default port 9100, you can change it if needed. Also, you can see various startup options using

Prometheus server will pull data from nodeexporter running on port 9100 .

You can go back to Prometheus web interface and see the metrics pulled from nodeexporter

I have created a youtube video here with complete installation steps

Please try it out and feel free to contact me if you face any issue.

Leave a Reply

Your email address will not be published. Required fields are marked *