Ejemplo n.º 1
0
<?php

set_time_limit(0);
include_once "config.inc.php";
include_once "templates/header.html";
include_once "templates/install_manager_sidebar.html";
$mysql = new Mysql();
$install = new Install();
$monitor = new NodeMonitor();
if (!@$_GET['action']) {
    echo '<div class="span10">
	' . $lang['chooseLeftSidebar'] . '
	</div>';
} elseif ($_GET['action'] == "Install") {
    if (!$_GET['ip']) {
        echo '<div class=span10>';
        echo '<h2>' . $lang['chooseInstallHost'] . '</h2>';
        $sql = "select * from ehm_hosts order by create_time desc";
        $mysql->Query($sql);
        echo '<table class="table table-striped">';
        echo '<thead>
                <tr>
                  <th>#</th>
                  <th>' . $lang['hostname'] . '</th>
                  <th>' . $lang['ipAddr'] . '</th>
                  <th>' . $lang['nodeRole'] . '</th>
                  <th>' . $lang['createTime'] . '</th>
                  <th>' . $lang['action'] . '</th>
                </tr>
                </thead>
                <tbody>';
Ejemplo n.º 2
0
<?php

set_time_limit(0);
include_once "config.inc.php";
include_once "templates/header.html";
include_once "templates/node_operator_sidebar.html";
$mysql = new Mysql();
$node = new NodeOperator();
$monitor = new NodeMonitor();
if (!@$_GET['action']) {
    echo '<div class="span10">
	' . $lang['chooseLeftSidebar'] . '
	</div>';
} elseif ($_GET['action'] == "Operate") {
    if (!@$_GET['do']) {
        $sql = "select * from ehm_hosts order by create_time desc";
        $mysql->Query($sql);
        echo '<div class=span10>';
        echo '<h2>' . $lang['operateNode'] . '</h2>';
        echo '<table class="table table-striped">';
        echo '<thead>
                <tr>
                  <th>#</th>
                  <th>' . $lang['hostname'] . '</th>
                  <th>' . $lang['ipAddr'] . '</th>
                  <th>' . $lang['action'] . '</th>
                  <th>' . $lang['action'] . '</th>
                </tr>
                </thead>
                <tbody>';
        $i = 1;
Ejemplo n.º 3
0
<?php

set_time_limit(0);
include_once "config.inc.php";
include_once "templates/header.html";
include_once "templates/node_monitor_sidebar.html";
$mysql = new Mysql();
$monitor = new NodeMonitor();
if (!$_GET['action']) {
} elseif ($_GET['action'] == 'MrUsed') {
    $sql = "select * from ehm_hosts where role like '%jobtracker%'";
    $mysql->Query($sql);
    $arr = $mysql->FetchArray();
    $ip = $arr['ip'];
    $hostname = $arr['hostname'];
    $json = $monitor->GetJson($ip, 'jobtracker');
    $map_slots = intval($monitor->GetJsonObject($json->{'beans'}, 'map_slots'));
    $reduce_slots = intval($monitor->GetJsonObject($json->{'beans'}, 'reduce_slots'));
    $running_maps = intval($monitor->GetJsonObject($json->{'beans'}, 'running_maps'));
    $running_reduces = intval($monitor->GetJsonObject($json->{'beans'}, 'running_reduces'));
    $perc_map_running = round($running_maps / $map_slots * 100);
    $perc_map_not_running = 100 - $perc_map_running;
    $perc_reduce_running = round($running_reduces / $reduce_slots * 100);
    $perc_reduce_not_running = 100 - $perc_reduce_running;
    echo "<div class=span10>";
    echo "<pre>";
    echo "Total Map Slots: " . $map_slots . " <br />";
    echo "Total Reduce Slots: " . $reduce_slots . " <br />";
    echo "Running Map Slots: " . $running_maps . " <br />";
    echo "Running Reduce Slots: " . $running_reduces . " <br />";
    echo "</pre>";
Ejemplo n.º 4
0
<?php

set_time_limit(0);
include_once "config.inc.php";
include_once "templates/header.html";
include_once "templates/node_monitor_sidebar.html";
$mysql = new Mysql();
$monitor = new NodeMonitor();
if (!$_GET['action']) {
    $sql = "select * from ehm_hosts where role like 'namenode%'";
    $mysql->Query($sql);
    $arr = $mysql->FetchArray();
    $ip = $arr['ip'];
    $hostname = $arr['hostname'];
    $json = $monitor->GetJson($ip, "namenode");
    #var_dump($json);
    $total = $monitor->GetJsonObject($json->{"beans"}, "Total");
    $free = $monitor->GetJsonObject($json->{"beans"}, "Free");
    $nondfs = $monitor->GetJsonObject($json->{"beans"}, "NonDfsUsedSpace");
    $dfs = $monitor->GetJsonObject($json->{"beans"}, "Used");
    $perc_free = round($free / $total * 100);
    $perc_nondfs = round($nondfs / $total * 100);
    $perc_dfs = 100 - ($perc_free + $perc_nondfs);
    echo '<div class=span10>';
    echo "<pre>";
    echo "Total DFS Space " . $monitor->GetRealSize($total) . " <br />";
    echo "Free DFS Space " . $monitor->GetRealSize($free) . " / " . $perc_free . "% Percentage <br />";
    echo "NonDFS Space " . $monitor->GetRealSize($nondfs) . " / " . $perc_nondfs . "% Percentage <br />";
    echo "DFS Space " . $monitor->GetRealSize($dfs) . " / " . $perc_dfs . "% Percentage <br />";
    echo "</pre>";
    echo '