Beispiel #1
0
 *
 * This file is part of Mandriva Management Console (MMC).
 *
 * MMC is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * MMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "modules/msc/includes/functions.php";
require "modules/msc/includes/machines.inc.php";
require "modules/msc/includes/command_history.php";
require "modules/msc/includes/scheduler_xmlrpc.php";
$ret = scheduler_ping_client('', $_GET["uuid"]);
if ($res == 11) {
    # connection refused
    print '<img style="vertical-align: middle;" alt="' . $coh['deleted'] . '" src="modules/msc/graph/images/status/' . return_icon("IGNORED") . '"/>';
    new NotifyWidgetFailure(_T("Connection was refused by the other side while trying to ping the machine", "msc"));
} elseif ($ret) {
    print '<img style="vertical-align: middle;" alt="' . $coh['deleted'] . '" src="modules/msc/graph/images/status/' . return_icon("DONE") . '"/>';
} else {
    print '<img style="vertical-align: middle;" alt="' . $coh['deleted'] . '" src="modules/msc/graph/images/status/' . return_icon("FAILED") . '"/>';
}
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * MMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC.  If not, see <http://www.gnu.org/licenses/>.
 */
require 'modules/msc/includes/commands_xmlrpc.inc.php';
require 'modules/msc/includes/functions.php';
if (strlen($_GET['cmd_id'])) {
    $cmd_id = $_GET['cmd_id'];
    $coh_ids = get_id_command_on_host($cmd_id);
    $coh = get_commands_on_host($coh_ids[0]);
    $title = get_command_on_host_title($cmd_id);
    $title = sprintf(_T("Command '%s' state concerning <b>%s</b>", "msc"), $title, $coh['host']);
    print "<h3>{$title}</h3>";
    $statusTable = getStatusTable();
    print '<table width="100%">';
    print '<tr><th>' . _T('Current State', 'msc') . '</th><th>' . _T('uploaded', 'msc') . '</th><th>' . _T('executed', 'msc') . '</th><th>' . _T('deleted', 'msc') . '</th></tr>';
    print '<tr><td>' . $statusTable[$coh['current_state']] . '</td>';
    print '<td width="33%"><img style="vertical-align: middle;" alt="' . $coh['uploaded'] . '" src="modules/msc/graph/images/status/' . return_icon($coh['uploaded']) . '"/></td> ';
    print '<td width="33%"><img style="vertical-align: middle;" alt="' . $coh['executed'] . '" src="modules/msc/graph/images/status/' . return_icon($coh['executed']) . '"/></td> ';
    print '<td width="33%"><img style="vertical-align: middle;" alt="' . $coh['deleted'] . '" src="modules/msc/graph/images/status/' . return_icon($coh['deleted']) . '"/></td> ';
    print '</tr></table>';
} else {
    print _T("error : cmd_id must be given", "msc");
}
function _plusIcon($a)
{
    $statusTable = getStatusTable();
    return sprintf('<img title="%s" alt="%s" src="modules/msc/graph/images/status/%s" />', $statusTable[$a], $a, return_icon($a));
}
Beispiel #4
0
         break;
     }
     $last_phase = $phase;
 }
 if ($last_phase) {
     $a_step_state[] = sprintf('%s (%s)', $phase_labels[$phase['name']], $state_labels[$phase['state']]);
 }
 if (!$running) {
     if (isset($statusTable[$coh['current_state']])) {
         $global_state = $statusTable[$coh['current_state']];
     } else {
         $global_state = $coh['current_state'];
     }
     $global_state = sprintf('<img style="vertical-align: middle;" alt="%s" src="modules/msc/graph/images/status/%s"/> &nbsp;&nbsp;', $coh['current_state'], return_icon($coh['current_state'])) . $global_state;
 } else {
     $global_state = sprintf('<img style="vertical-align: middle;" alt="%s" src="modules/msc/graph/images/status/%s"/> &nbsp;&nbsp;%s', 'running', return_icon('running'), _T('Running', 'msc)'));
 }
 $a_current[] = $global_state;
 $p = array('coh_id' => $coh_id, 'cmd_id' => $cmd['id'], 'tab' => $tab, 'uuid' => $uuid, 'hostname' => $coh['host'], 'from' => 'msc|logs|viewLogs', 'gid' => $gid);
 if (strlen($cmd['bundle_id'])) {
     $p['bundle_id'] = $cmd['bundle_id'];
 }
 $params[] = $p;
 $icons = state_tmpl($coh['current_state']);
 $icons['play'] == '' ? $a_start[] = $actionempty : ($a_start[] = $actionplay);
 $icons['stop'] == '' ? $a_stop[] = $actionempty : ($a_stop[] = $actionstop);
 $icons['pause'] == '' ? $a_pause[] = $actionempty : ($a_pause[] = $actionpause);
 if (isset($_GET['coh_id']) && $coh_id == $_GET['coh_id']) {
     $a_details[] = $actionempty;
 } else {
     $a_details[] = $actiondetails;
Beispiel #5
0
        $icon = return_icon("DONE");
        $title = sprintf(_T('Target platform is %s', 'msc'), $res);
    }
} elseif ($probe_order == "ping_ssh") {
    $res = scheduler_ping_client('', $_GET["uuid"]);
    if ($res === 11) {
        new NotifyWidgetFailure(_T("Connection was refused by the other side while trying to probe the machine", "msc"));
        $icon = return_icon("IGNORED");
        $title = _T('Error scheduler-side !', 'msc');
    } elseif ($res === false) {
        $icon = return_icon("FAILED");
        $title = _T('Ping failed', 'msc');
    } else {
        $res = scheduler_probe_client('', $_GET["uuid"]);
        if ($res === 11) {
            new NotifyWidgetFailure(_T("Connection was refused by the other side while trying to probe the machine", "msc"));
            $icon = return_icon("IGNORED");
            $title = _T('Error scheduler-side !', 'msc');
        } elseif ($res === "Not available") {
            $icon = return_icon("FAILED");
            $title = _T('Ping succeeded, SSH connection failed', 'msc');
        } else {
            $icon = return_icon("DONE");
            $title = sprintf(_T('Target platform is %s', 'msc'), $res);
        }
    }
} else {
    $icon = return_icon("IGNORED");
    $title = _T('No probe performed', 'msc');
}
printf('<img style="vertical-align: sub;" title="%s"src="modules/msc/graph/images/status/%s"/>', $title, $icon);