ansible/roles/nagios_server/templates/nagios/plugins/check_koji.j2
2020-06-08 11:17:20 -04:00

18 lines
428 B
Django/Jinja
Executable file

#!/bin/bash
FAILURES=$(/usr/bin/wget --timeout=60 -q -O- http://koji.{{ datacenter }}.fedoraproject.org/koji/builds | /bin/grep -c failed.png)
WARNING=20
CRITICAL=25
if [ $FAILURES -gt $CRITICAL ]
then
echo "Koji: CRITICAL failed builds: $FAILURES"
exit 2
elif [ $FAILURES -gt $WARNING ]
then
echo "Koji: WARNING failed builds: $FAILURES"
exit 1
else
echo "Koji: OK failed builds: $FAILURES"
exit 0
fi