Restore api behaviour. Add zmu output to response
This commit is contained in:
parent
195f9fc403
commit
8511d814df
|
@ -291,16 +291,18 @@ class MonitorsController extends AppController {
|
|||
|
||||
$shellcmd = escapeshellcmd(ZM_PATH_BIN."/zmu $verbose -m$id $q $auth");
|
||||
$status = exec($shellcmd, $output, $rc);
|
||||
if ($status) {
|
||||
if ($rc) {
|
||||
$this->set(array(
|
||||
'status'=>$rc,
|
||||
'error'=>$output,
|
||||
'_serialize' => array('status','error'),
|
||||
'status'=>'false',
|
||||
'code' => $rc,
|
||||
'error'=> implode(PHP_EOL, $output),
|
||||
'_serialize' => array('status','code','error'),
|
||||
));
|
||||
} else {
|
||||
$this->set(array(
|
||||
'status' => 'Ok',
|
||||
'_serialize' => array('status'),
|
||||
'status' => $status,
|
||||
'output' => implode(PHP_EOL, $output),
|
||||
'_serialize' => array('status','output'),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue