diff --git a/roles/nagios_client/files/scripts/check_osbs_builds.py b/roles/nagios_client/files/scripts/check_osbs_builds.py index ef0a4700a2..7199620b4b 100755 --- a/roles/nagios_client/files/scripts/check_osbs_builds.py +++ b/roles/nagios_client/files/scripts/check_osbs_builds.py @@ -4,19 +4,16 @@ import subprocess import sys sp = subprocess.Popen( - ["osbs", "list-builds"], + ["oc", "-n", "osbs-fedora", "get", "builds"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE ) sp_out, sp_err = sp.communicate() -sp_err = sp_err.split('\n') +sp_out = sp_out.split('\n') -if 'not attached to terminal' in sp_err[0]: - sp_err = sp_err[1:] - -if sp_err[0].split()[0] == 'BUILD': - print "OK: OSBS is responsive to 'osbs list-builds'" +if sp_out[0].split()[0] == 'NAME': + print "OK: OSBS is responsive to 'oc get builds'" sys.exit(0) else: print "CRITICAL: OSBS UNRESPONSIVE"