NAGIOS: Update check_osbs_builds check to use Openshift cli instead of osbs-client
Signed-off-by: Clement Verna <cverna@tutanota.com>
This commit is contained in:
parent
ef61cb0d11
commit
eb5e9a5138
1 changed files with 4 additions and 7 deletions
|
@ -4,19 +4,16 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
sp = subprocess.Popen(
|
sp = subprocess.Popen(
|
||||||
["osbs", "list-builds"],
|
["oc", "-n", "osbs-fedora", "get", "builds"],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE,
|
stderr=subprocess.PIPE,
|
||||||
stdin=subprocess.PIPE
|
stdin=subprocess.PIPE
|
||||||
)
|
)
|
||||||
sp_out, sp_err = sp.communicate()
|
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]:
|
if sp_out[0].split()[0] == 'NAME':
|
||||||
sp_err = sp_err[1:]
|
print "OK: OSBS is responsive to 'oc get builds'"
|
||||||
|
|
||||||
if sp_err[0].split()[0] == 'BUILD':
|
|
||||||
print "OK: OSBS is responsive to 'osbs list-builds'"
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
print "CRITICAL: OSBS UNRESPONSIVE"
|
print "CRITICAL: OSBS UNRESPONSIVE"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue