Exemple #1
0
function _get_command_start_date($cmd_id)
{
    $command_details = command_detail($cmd_id);
    list($year, $month, $day, $hour, $minute, $second) = $command_details['start_date'];
    return sprintf("%s-%s-%s %s:%s:%s", $year, $month, $day, $hour, $minute, $second);
}
 function CommandHistory($coh_id)
 {
     // TODO : ch is a list, we have to chose the good one (ie : the most recent date)
     $this->db_ch = get_command_history($coh_id);
     $this->db_coh = get_commands_on_host($coh_id);
     if ($this->db_coh['fk_use_as_proxy']) {
         $this->db_lproxy = get_commands_on_host($this->db_coh['fk_use_as_proxy']);
     } else {
         $this->db_lproxy = NULL;
     }
     $this->db_cmd = command_detail($this->db_coh['fk_commands']);
 }
Exemple #3
0
                #array('tab'=>$tab, 'uuid'=>$uuid, 'hostname'=>$hostname)));
                exit;
            }
        }
    }
} else {
    /* Form displaying */
    $from = $_GET['from'];
    $hostname = $_GET["hostname"];
    $groupname = $_GET["groupname"];
    $uuid = $_GET["uuid"];
    $cmd_id = $_GET["cmd_id"];
    $coh_id = $_GET["coh_id"];
    $gid = $_GET["gid"];
    $bundle_id = $_GET['bundle_id'];
    $cmd = command_detail($cmd_id);
    $name = $cmd['title'];
    if (!$name && $_GET['title']) {
        $name = $_GET['title'];
    }
    $action_type = _T('action', 'msc');
    if (strlen($bundle_id)) {
        $action_type = _T('bundle', 'msc');
    }
    if (strlen($gid) && !strlen($coh_id)) {
        $title = sprintf(_T("Stop %s %s on this group", 'msc'), $action_type, $name);
    } else {
        $title = sprintf(_T("Stop %s %s on host %s", 'msc'), $action_type, $name, $hostname);
    }
    $f = new PopupForm($title);
    $f->add(new HiddenTpl("name"), array("value" => $hostname, "hide" => True));
Exemple #4
0
}
$params["papi"] = $papi;
$params["name"] = $hostname;
$params["hostname"] = $hostname;
$params["uuid"] = $uuid;
$params["gid"] = $gid;
$params["from"] = $from;
$params["pid"] = $pid;
$params["create_directory"] = 'on';
$params["next_connection_delay"] = web_def_delay();
$params["max_connection_attempt"] = web_def_attempts();
if ($_GET['editConvergence']) {
    $ServerAPI = new ServerAPI();
    $ServerAPI->fromURI($papi);
    $cmd_id = xmlrpc_get_convergence_command_id($gid, $ServerAPI, $pid);
    $command_details = command_detail($cmd_id);
    $command_phases = xmlrpc_get_convergence_phases($gid, $ServerAPI, $pid);
    $params["ltitle"] = $command_details['title'];
    $params["maxbw"] = $command_details['maxbw'] / 1024;
    $params["copy_mode"] = $command_details['copy_mode'];
    $params["deployment_intervals"] = $command_details['deployment_intervals'];
    $params["parameters"] = $command_details['parameters'];
    $params["editConvergence"] = True;
    $params["active"] = xmlrpc_is_convergence_active($gid, $ServerAPI, $pid) ? 'on' : '';
    // phases
    foreach (array('start_script', 'clean_on_success', 'do_reboot', 'do_wol', 'do_inventory', 'do_halt') as $key) {
        if ($command_phases) {
            // $command_phases is False with old convergence implementation (without phases stored in Convergence DB)
            if ($key == 'do_halt') {
                $params['issue_halt_to_done'] = in_array('done', $command_phases['issue_halt_to']) ? 'on' : '';
            } else {