Clone the repository containing automation scripts:
git clone https://github.com/DevOps-Model/DevOps-Automation-Scripts.git
cd DevOps-Automation-Scripts
python3 MonitoringSetup.py monitoring.conf node_exporter mysql
The ScyllaDB exporter is included as part of the ScyllaDB stack installation script.
The Redpanda exporter is set up during the Redpanda stack installation.
Create the following directory:
mkdir -p /opt/tomcat_exporter
Download the JMX Prometheus Java Agent
wget https://repo.maven.apache.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/1.0.1/jmx_prometheus_javaagent-1.0.1.jar -O /opt/tomcat_exporter/jmx_prometheus_javaagent-1.0.1.jar
Create the Configuration File
vi /opt/tomcat_exporter/config.yaml
rules:
- pattern: ".*"
chmod 755 /opt/tomcat_exporter
chown -R tomcat:tomcat /opt/tomcat_exporter
Configure the Tomcat Service
Integrate the exporter with the Tomcat service:
vi /etc/systemd/system/tomcat-pssb.service
CATALINA_OPTS
with the following line:
Environment="CATALINA_OPTS=-javaagent:/opt/tomcat_exporter/jmx_prometheus_javaagent-1.0.1.jar=9115:/opt/tomcat_exporter/config.yaml"
Reload and Restart the Service
Apply the changes to the Tomcat service:
systemctl daemon-reload
systemctl restart tomcat-pssb
Verify the Tomcat Exporter
Access the metrics endpoint to ensure the Tomcat Exporter is running correctly:
http://<server_ip>:9115/metrics
Replace <server_ip>
with the server’s IP address.
Use the following script to install and configure the GlusterFS exporter:
#!/bin/bash
GEXPORTER="/usr/sbin/gluster-exporter"
ufw allow 9106/tcp
ufw reload
wget https://github.com/nilpntr/gluster-exporter/releases/download/1.0.1/gluster_exporter-1.0.1.linux-amd64
mv gluster_exporter-1.0.1.linux-amd64 /usr/sbin/gluster-exporter
chmod u+x /usr/sbin/gluster-exporter
# Create a systemd service file
touch /etc/systemd/system/gluster-exporter.service
cat << 'EOF' > /etc/systemd/system/gluster-exporter.service
[Unit]
Description=Gluster Exporter on :9106
After=network.target
[Service]
Restart=on-failure
ExecStart=/usr/sbin/gluster-exporter --profile --quota
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable gluster-exporter
systemctl start gluster-exporter
Ensure the necessary ports are accessible on each node for the respective exporters:
Exporter | Port |
---|---|
MySQL Exporter | 9104 |
ScyllaDB Exporter | 9180 |
Node Exporter | 9200 |
Redpanda Exporter | 9644 |
Tomcat Exporter | 9115 |
GlusterFS Exporter | 9106 |
Run the following commands to allow the ports:
sudo ufw allow 9104
sudo ufw allow 9180
sudo ufw allow 9200
sudo ufw allow 9644
sudo ufw allow 9115
sudo ufw allow 9106