Don't both running zmu if monitor Function is set to None

This commit is contained in:
Isaac Connor 2021-12-10 16:08:43 -05:00
parent ed360348ef
commit 5312d11e78
1 changed files with 9 additions and 1 deletions

View File

@ -321,12 +321,20 @@ class MonitorsController extends AppController {
}
$monitor = $this->Monitor->find('first', array(
'fields' => array('Id', 'Type', 'Device'),
'fields' => array('Id', 'Type', 'Device', 'Function'),
'conditions' => array('Id' => $id)
));
// Clean up the returned array
$monitor = Set::extract('/Monitor/.', $monitor);
if ($monitor[0]['Function'] == 'None') {
$this->set(array(
'status' => false,
'statustext' => 'Monitor function is set to None',
'_serialize' => array('status','statustext'),
));
return;
}
// Pass -d for local, otherwise -m
if ( $monitor[0]['Type'] == 'Local' ) {