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>"; echo '
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 ' <div class="progress">