Franziska Kunsmann
05670ac2bb
All checks were successful
bundlewrap/pipeline/head This commit looks good
25 lines
555 B
Python
25 lines
555 B
Python
#!/usr/bin/env python3
|
|
|
|
from subprocess import check_output
|
|
|
|
from flask import Flask
|
|
|
|
app = Flask(__name__)
|
|
|
|
@app.route('/status')
|
|
def statuspage():
|
|
everything_fine = True
|
|
try:
|
|
check_output(['/usr/lib/nagios/plugins/check_procs', '-C', 'icinga2', '-c', '1:'])
|
|
except:
|
|
everything_fine = False
|
|
|
|
try:
|
|
check_output(['/usr/lib/nagios/plugins/check_procs', '-C', 'postgres', '-c', '1:'])
|
|
except:
|
|
everything_fine = False
|
|
|
|
if everything_fine:
|
|
return 'OK', 200
|
|
|
|
return 'Something is wrong!', 500
|