add mysqld exporter

This commit is contained in:
CN-JS-HuiBai
2026-01-25 14:17:42 +08:00
parent d75e898d2d
commit 3f55309527
2 changed files with 118 additions and 0 deletions

View File

@@ -93,6 +93,17 @@ WantedBy=multi-user.target
EOF
# Create systemd service restart file
echo "Create systemd service restart file..."
sudo tee "/usr/bin/restart_prometheus" > /dev/null <<EOF
#!/bin/bash
systemctl daemon-reload
systemctl restart prometheus.service
systemctl status prometheus.service
EOF
sudo chmod 755 /usr/bin/restart_prometheus
# Reload systemd, enable and start service
echo "Enabling and starting Prometheus service..."
sudo systemctl daemon-reload