Compare commits
No commits in common. "fd8a67c23c3c5c4c09ad2c6df324c351f2e1974f" and "e004a1002eb43568b3a23d4943598d8d044f1693" have entirely different histories.
fd8a67c23c
...
e004a1002e
14
index.php
14
index.php
@ -13,12 +13,8 @@ if(php_sapi_name() == 'cli' || $_SERVER["REQUEST_URI"] == '/metrics') {
|
||||
if (isset($submetric['command'])) {
|
||||
$output = null;
|
||||
$retval = null;
|
||||
try {
|
||||
exec($submetric['command'], $output, $retval);
|
||||
$output = implode("\n", $output);
|
||||
} catch (Exception $e) {
|
||||
$output = '';
|
||||
}
|
||||
} elseif (isset($submetric['http'])) {
|
||||
$client = new GuzzleHttp\Client();
|
||||
|
||||
@ -47,17 +43,9 @@ if(php_sapi_name() == 'cli' || $_SERVER["REQUEST_URI"] == '/metrics') {
|
||||
}
|
||||
|
||||
if (isset($submetric['http']['data']) && $submetric['http']['data'] == 'responsebody') {
|
||||
if ($hasresponse) {
|
||||
$output = $res->getBody()->getContents();
|
||||
} else {
|
||||
$output = '';
|
||||
}
|
||||
} elseif ((isset($submetric['http']['statuscode'])) && (isset($submetric['http']['data']) && $submetric['http']['data'] == 'hasresponse')) {
|
||||
if ($hasresponse) {
|
||||
$output = $output = (int)in_array($res->getStatusCode(), $submetric['http']['statuscode']);;
|
||||
} else {
|
||||
$output = 0;
|
||||
}
|
||||
$output = (int)in_array($res->getStatusCode(), $submetric['http']['statuscode']);
|
||||
} elseif (isset($submetric['http']['data']) && $submetric['http']['data'] == 'hasresponse') {
|
||||
$output = (int)$hasresponse;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user