Use ->zmaControl instead of invalid zmaControl(). the old zmaControl takes a mid, not a monitor object
This commit is contained in:
parent
24d8b99eea
commit
aa7ba44ed9
|
@ -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.');
|
||||
|
|
Loading…
Reference in New Issue