$aesList = array(); if (is_array($domainList)) { reset($domainList); foreach ($domainList as $domain_data) { if ($domain_data['domain_hd_check'] == 1) { //echo '<pre>'. print_r($domain_data, true) .'</pre>'; $adminService = new MyAdminService(); if (@$adminService->connect($domain_data['domain_as_host'], $domain_data['domain_as_port'], $res) !== false) { $status = $adminService->getStates(); $domainServices = tool_main_parse_status($status); $aesList = tool_main_get_aes_from_status($domainServices); //echo '<pre>'. print_r($aesList, true) .'</pre>'; if (sizeof($aesList)) { reset($aesList); foreach ($aesList as $service) { $adminService->serviceCmd($service, $service_command); if (!$adminService->waitCallback()) { // error } } $aes_df_result = $tpl->get_template_vars('tool_execute_result'); $tpl->clear_assign('tool_execute_result'); if (defined('NELTOOL_NO_USER_NEEDED') && defined('NELTOOL_CRON_DEBUG')) { echo '<pre>' . print_r($aes_df_result, true) . '</pre>'; } tool_main_update_hd_data_for_domain($domain_data['domain_id'], $aes_df_result); } unset($adminService); } } }
$service_egs = $NELTOOL['POST_VARS']['restart_egs']; $restart_stop_services = $NELTOOL['POST_VARS']['restart_stop_services']; if (isset($NELTOOL['POST_VARS']['restart_check_ws'])) { // we are starting the restart sequence $restart_ws_state = $NELTOOL['POST_VARS']['restart_ws_state']; if ($restart_ws_state == 'open') { // shard needs a regular restart // - broadcast a message on the shard $restart_reboot_message_id = $NELTOOL['POST_VARS']['restart_message_reboot_id']; $restart_reboot_message_data = tool_admin_restart_messages_get_id($restart_reboot_message_id); $restart_reboot_message = $restart_reboot_message_data['restart_message_value']; if ($restart_reboot_message != '') { $service_command = "broadcast repeat=10 every=60 " . $restart_reboot_message; nt_log("Domain '{$AS_Name}' : '{$service_command}' on " . $service_egs); nt_common_add_debug("about to run command '{$service_command}' on '{$service_egs}' ..."); $adminService->serviceCmd($service_egs, $service_command); if (!$adminService->waitCallback()) { nt_common_add_debug('Error while waiting for callback on service \'' . $service_egs . '\' for command : ' . $service_command); } $tpl->clear_assign('tool_execute_result'); } // - prepare next step (timer countdown to 10 minutes) if ($restart_shard_id == 301) { // Fast restart for yubo shard (1mn) tool_main_set_restart_sequence_timer($tool_seq_id, 60); nt_common_add_debug("fast restart for yubo shard 301"); } else { tool_main_set_restart_sequence_timer($tool_seq_id, 600); nt_common_add_debug("normal restart for live shard"); } // - lets start by locking the WS