Saturday, October 17, 2020

 RABBITMQ Monitoring with Prometheus-Grafana and ELK stack


Prometheus Installation

Step 1 : Download Latest Prometheus from the bellow url

·         https://github.com/prometheus/prometheus/releases/download/v2.16.0/prometheus-2.16.0.windows-amd64.tar.gz

Step 2 : Configure Prometheus with Rabbitmq. Unzip the file and locate “prometheus.yml”

·         Modify  the config parameters as below for prometheus.yml

scrape_configs:

- job_name: 'prometheus'

                static_configs:

                 - targets: ['<IP1>:9090']

- job_name: 'rabbitmq'

static_configs:

    - targets: ['<IP1>:15692']

    - targets: ['<IP2>:15692']

·         Start Prometheus by clicking prometheus.exe

·         Access the Prometheus Dashboard using the below link

http://<IP1:9090/

Rabbitmq-Prometheus

Grafana Installation

Step 1 :Download latest Grafana from the below url

·         https://dl.grafana.com/oss/release/grafana-6.6.2.windows-amd64.zip

Step 2 : Unzip the file and locate “defaults.ini”. Modify defaults.ini file with IP as below

domain = <ip address>

·         Start Prometheus with grafana-server.exe

·         Access the Prometheus Dashboard using the below link

http://<ip address:3000/

username:admin

password:admin

·         Select the datasource as prometheus and change the url with correct IP and port

·         Free Dashboards can be downloaded from

o   https://grafana.com/grafana/dashboards?dataSource=prometheus&category=rabbitmq

 

To Run Grafana& Prometheus as Service

Step 1 :Stop Grafana and Prometheus

Step 2 :Download NSSM from https://nssm.cc/download

Step 3 :From the zip file, copy “win64/nssm.exe” into both Prometheus and grafana folders

For Grafana

Step 1: From the command prompt:

·         nssm install grafana<exe file name with full location>

Step 2: Start the service from "services"

For Prometheus

Step 1: From the command prompt:

·         nssm install prometheus<exe file name with full location>

Step 2: Start the service from "services"

NOTE: Use the below command to edit the NSSm interface

·         nssm edit prometheus/grafana

 

RABBITMQ with ELK stack Integration

Step 1: Download the latest Metricbeat Windows zip file from the Download page.

https://www.elastic.co/downloads/beats/metricbeat

Step 2: Extract the contents of the zip file into C:\Program Files.

Step 3: Rename the metricbeat-7.6.0-windows directory to Metricbeat.

Step 4: Open a PowerShell prompt as an Administrator and run the following commands to install Metricbeat as a Windows service.

·         cd "C:\Program Files\Metricbeat"

·         .\install-service-metricbeat.ps1

Step 5: Modify the settings under output.elasticsearch in the C:\Program Files\Metricbeat\metricbeat.yml file to point to your Elasticsearch installation.

output.elasticsearch:

hosts: ["<es_url>"]

username: "elastic"

password: "<password>"

 

setup.kibana:

host: "<kibana_url>"

 

Step 6: From the C:\Program Files\Metricbeat folder, run:

·         .\metricbeat.exe modules enable rabbitmq

Step 7 :Modify the settings in the modules.d/rabbitmq.yml file.

- module: rabbitmq

metricsets:

    - node

    - queue

    - connection

period: 10s

hosts: ["localhost:15672"]

Step 8 :The setup command loads the Kibana dashboards. If the dashboards are already set up, omit this command.

·         .\metricbeat.exe setup

·         Start-Service metricbeat

Step 9: Check that data is received from the Metricbeatrabbitmq module to Kibana

                http://<ip address:5601/

NOTE: Use the default dashboard in kibana to visualize the data.

No comments:

Post a Comment