close

1/Configure multiple web using Virtual Host on Apache Server:

– Create directory for storing app content file:

– Configure virtual host

Edit /etc/httpd/conf/httpd.conf

– Create Virtual Host Configuration File

– Start service httpd and check app access

2/Enable Apache Server Status Page:

– Create and edit file /etc/httpd/conf.d/server-status.conf

– Try access server-status page of Apache Server

3/Install apache-exporters for exposing metric for Prometheus pulling:

– Install Go and Git

# curl -O https://dl.google.com/go/go1.11.linux-amd64.tar.gz

# tar -C /usr/local -xvzf go1.11.linux-amd64.tar.gz

# echo “export GOPATH=$HOME/go” >> ~/.profile

# echo “export PATH=$PATH:/usr/local/go/bin” >> ~/.profile

# source ~/.profile

# yum install git

– Install and configure Apache-Exporter

# useradd apache_exporter -s /sbin/nologin

# cd /tmp; curl -s https://api.github.com/repos/Lusitaniae/apache_exporter/releases/latest   | grep browser_download_url   | grep linux-amd64 | cut -d ‘”‘ -f 4 | wget -qi –

# tar xvf apache_exporter-*.linux-amd64.tar.gz

# cp apache_exporter-*.linux-amd64/apache_exporter /usr/local/bin

# chmod +x /usr/local/bin/apache_exporter

– Create Apache Prometheus exporter systemd service

Create file /etc/systemd/system/apache_exporter.service

– Start the apache_exporter service:

– Check HTTP endpoint for exposing metrics

4/Add Apache Server As Target To Prometheus Server:

– Edit prometheus configuration file:

– Reload target configuration for Prometheus Server

5/Create Prometheus Alert Rule for Checking status of Apache Server:

– Include alert rule file to prometheus configurtion

– Create new alert rule with label and annotations with descriptions:

– Check new alert rule on Prometheus UI

6/Install/Confgure Prometheus Alert Manager For Sending Email Notification:

– Download prometheus Alert Manager:

https://prometheus.io/download/#alertmanager

– Upload ad extract source to prometheus server

– Configure prometheus send alert to alert manager

– Configuration for send mail notification when Prometheus has firing alert

– Start alert manager server

– Testing alert send notifications by stop Apache service. On prometheus UI will firing alerting

– Check on Alert Manager UI received alert from prometheus

– Check mail notification for this alert

Tags : AutomationContainerDevOpsK8sKubernetesLinux-Unix

Leave a Response

error: Content is protected !!