Tuesday, May 25, 2021

Prometheus and Grafana : Monitor Apache

1. Download apache_exporter
#wget https://github.com/Lusitaniae/apache_exporter/releases/download/v1.0.2/apache_exporter-1.0.2.linux-amd64.tar.gz

2.Install apache_exporter
#tar xvzf apache_exporter-1.0.2.linux-amd64.tar.gz
#cd apache_exporter-1.0.2.linux-amd64
#chown apache:apache apache_exporter
# mv apache_exporter /usr/bin

3.Create apache_exporter services
#vi /etc/systemd/system/apache-exporter.service
- insert script as below

[Unit]
Description=Apache Server Exporter
Documentation=https://github.com/Lusitaniae/apache_exporter
After=network-online.target

[Service]
User=apache
Group=apache
Restart=on-failure
ExecStart=/usr/bin/apache_exporter

[Install]
WantedBy=multi-user.target

4.Enable apache_exporter services

#systemctl daemon-reload
#systemctl enable apache-exporter.servic
# systemctl start apache-exporter.service

5.curl the locahost with port 9117
#curl http://localhost:9117/metrics
#systemctl restart httpd

* makes sure allow port 9117 in firewall

source:


Related Posts:

0 comments:

Post a Comment