diff --git a/web/includes/actions.php b/web/includes/actions.php index 384953940..6f25a40d0 100644 --- a/web/includes/actions.php +++ b/web/includes/actions.php @@ -485,6 +485,9 @@ if ( canEdit( 'Monitors' ) ) { $columns = getTableColumns( 'Monitors' ); $changes = getFormChanges( $monitor, $_REQUEST['newMonitor'], $types, $columns ); + if ( isset($changes['ServerId']) and $changes['ServerId'] == 'auto' ) { + $changes['ServerId'] = dbFetchOne( 'SELECT Id FROM Servers WHERE Status=\'Running\' ORDER BY FreeMem, CpuLoad LIMIT 1', 'Id' ); + } if ( count( $changes ) ) { if ( $mid ) {