Use ->zmaControl instead of invalid zmaControl(). the old zmaControl takes a mid, not a monitor object

This commit is contained in:
Isaac Connor 2020-09-29 16:48:22 -04:00
parent 24d8b99eea
commit aa7ba44ed9
1 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ if ( !canEdit('Monitors', $mid) ) {
if ( $action == 'function' ) {
$monitor = new ZM\Monitor($mid);
if ( !$monitor ) {
if ( !$monitor->Id() ) {
ZM\Error("Monitor not found with Id=$mid");
return;
}
@ -46,10 +46,10 @@ if ( $action == 'function' ) {
$monitor->save(array('Function'=>$newFunction, 'Enabled'=>$newEnabled));
if ( daemonCheck() && ($monitor->Type() != 'WebSite') ) {
zmaControl($monitor, 'stop');
zmcControl($monitor, ($newFunction != 'None') ? 'restart' : 'stop');
$monitor->zmaControl('stop');
$monitor->zmcControl(($newFunction != 'None') ? 'restart' : 'stop');
if ( $newFunction != 'None' && $newFunction != 'NoDect' )
zmaControl($monitor, 'start');
$monitor->zmaControl('start');
}
} else {
ZM\Logger::Debug('No change to function, not doing anything.');