示例#1
0
     break;
 case "disable":
     if (isset($id_host)) {
         if (isDeactivable($SQL, $table, $id_host)) {
             $passwd = makePassword();
             $query = 'SELECT * FROM `' . $table . '` WHERE register = "yes" AND id_host=' . $id_host;
             $res = $SQL->DoQuery($query);
             $nb = $SQL->NumRows();
             if ($nb && strlen($m_hostname) > 0) {
                 $row = $SQL->FetchResult($res);
                 $s_ip = $row["address"];
                 $s_hostname = $row["hostname"];
                 if (isset($s_ip) && isset($s_hostname)) {
                     disable_hostDB($SQL, $table, $id_host);
                     popup_info(sprintf(_('Host %s has been set in standby and master %s will restart Heartbeat!'), $s_hostname, $m_hostname));
                     $ret = ShellExec::exec_action_to_host($s_hostname, "on");
                     $ret = ShellExec::exec_shell_cmd("reload_master_excl", "0", "0", $passwd);
                     $upd_slave = true;
                     break;
                 } else {
                     popup_error(sprintf(_('Cannot query slave host at address %s'), $s_ip));
                     break;
                 }
             } else {
                 popup_error(_('An error occured during disabling, can not disable host!'));
             }
         }
     }
     break;
 case "reload_vip":
     $prefs = Preferences::getInstance();
示例#2
0
文件: status.php 项目: skdong/nfs-ovd
function action_to_hosts($action, $host)
{
    Logger::warning('ha', "status.php::action to host requested standby='" . $action . "' to host '" . $host . "'");
    $ret = ShellExec::exec_action_to_host($action, $host);
}