Last active
January 16, 2024 15:05
-
-
Save muhamad-ridwant-tech/cdef36610f7825ffa286504bc0935683 to your computer and use it in GitHub Desktop.
Check services with pushgateway prometheus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
status="$(systemctl is-active Services_Name])" | |
if [ "$status" = "active" ]; then | |
echo "Services_Name 1" | curl --data-binary @- http://localhost:9091/metrics/job/Pushgateway/instance/compute-01 | |
else | |
echo "Service_Name 0" | curl --data-binary @- http://localhost:9091/metrics/job/Pushgateway/instance/compute-01 | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment