Fix the osbs nagios script
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
parent
c9cba944c8
commit
6685841b7c
1 changed files with 7 additions and 3 deletions
|
@ -6,14 +6,18 @@ import sys
|
|||
sp = subprocess.Popen(
|
||||
["osbs", "list-builds"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE
|
||||
stderr=subprocess.PIPE,
|
||||
stdin=subprocess.PIPE
|
||||
)
|
||||
sp_out, sp_err = sp.communicate()
|
||||
sp_err = sp_err.split('\n')
|
||||
|
||||
if sp_err.split()[0] == 'BUILD':
|
||||
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'"
|
||||
sys.exit(0)
|
||||
else:
|
||||
print "CRITICAL: OSBS UNRESPONSIVE"
|
||||
sys.exit(2)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue