Changeset 759 for branches/0.4/web/addons/job_monarch
- Timestamp:
- 03/27/13 20:50:05 (11 years ago)
- Location:
- branches/0.4/web/addons/job_monarch
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.4/web/addons/job_monarch/graph.php
r758 r759 441 441 } 442 442 443 if ($graph == "job_report") 444 { 445 $title = "Last: $j_title"; 443 if($graph == "job_report") 444 { 445 if($range == 'job' ) 446 { 447 $title = "Last: $j_title"; 448 } 449 else 450 { 451 $title = "Last: $range"; 452 } 446 453 } 447 454 else -
branches/0.4/web/addons/job_monarch/host_view.php
r751 r759 31 31 $context = 'cluster'; 32 32 33 chdir( $GANGLIA_PATH ); 34 35 include "./ganglia.php"; 36 include "./get_ganglia.php"; 37 38 chdir( $my_dir ); 33 if( $view == "overview-host" ) 34 { 35 chdir( $GANGLIA_PATH ); 36 37 include "./ganglia.php"; 38 include "./get_ganglia.php"; 39 40 chdir( $my_dir ); 41 } 39 42 40 43 function datetimeToEpoch( $datetime ) … … 68 71 { 69 72 70 global $ tpl, $metrics, $clustername, $hostname;73 global $dwoo, $metrics, $clustername, $hostname; 71 74 global $cluster_ul, $hosts_up, $get_metric_string; 72 75 global $cluster, $period_start, $period_stop; 73 76 global $job_start, $job_stop, $view, $conf, $range; 77 78 $tpl = new Dwoo_Template_File("templates/host_view.tpl"); 79 $tpl_data = new Dwoo_Data(); 74 80 75 81 $rrdirs = array(); … … 124 130 $hosts_up = $hosts_up[$hostname]; 125 131 126 $tpl ->assign("cluster", $clustername);127 $tpl ->assign("host", $hostname);128 $tpl ->assign("node_image", "../../".node_image($metrics));129 $tpl ->assign("sort",$sort);130 $tpl ->assign("range",$range);132 $tpl_data->assign("cluster", $clustername); 133 $tpl_data->assign("host", $hostname); 134 $tpl_data->assign("node_image", "../../".node_image($metrics)); 135 $tpl_data->assign("sort",$sort); 136 $tpl_data->assign("range",$range); 131 137 132 138 if( !is_numeric( $period_start ) ) … … 140 146 141 147 if($hosts_up) 142 $tpl ->assign("node_msg", "This host is up and running.");148 $tpl_data->assign("node_msg", "This host is up and running."); 143 149 else 144 $tpl ->assign("node_msg", "This host is down.");150 $tpl_data->assign("node_msg", "This host is down."); 145 151 146 152 $cluster_url=rawurlencode($clustername); 147 $tpl ->assign("cluster_url", $cluster_url);153 $tpl_data->assign("cluster_url", $cluster_url); 148 154 149 155 $graphargs = "h=$hostname&r=$range&job_start=$job_start&job_stop=$job_stop"; … … 159 165 } 160 166 161 $tpl ->assign("graphargs", "$graphargs");167 $tpl_data->assign("graphargs", "$graphargs"); 162 168 163 169 # For the node view link. 164 $tpl ->assign("node_view","./?p=2&c=$cluster_url&h=$hostname");165 166 $tpl ->assign("ip", $hosts_up[IP]);170 $tpl_data->assign("node_view","./?p=2&c=$cluster_url&h=$hostname"); 171 172 $tpl_data->assign("ip", $hosts_up[IP]); 167 173 168 174 #print_r( $mymetrics ); … … 221 227 { 222 228 ksort($s_metrics); 229 $string_metric_info_loop = array(); 223 230 foreach ($s_metrics as $name => $v ) 224 231 { 225 $ tpl->newBlock("string_metric_info");226 $ tpl->assign("name", $name);232 $metric_info = array(); 233 $metric_info["name"] = $name; 227 234 if( $v[TYPE]=="timestamp" or $always_timestamp[$name]) 228 235 { 229 $ tpl->assign("value", date("r", $v[VAL]));236 $metric_info["value"] = date("r", $v[VAL]); 230 237 } 231 238 else 232 239 { 233 $tpl->assign("value", "$v[VAL] $v[UNITS]"); 234 } 235 } 240 $metric_info["value"] = "$v[VAL] $v[UNITS]"; 241 } 242 $string_metric_info_loop[] = $metric_info; 243 } 244 $tpl_data->assign("string_metric_info", $string_metric_info_loop ); 236 245 } 237 246 … … 240 249 { 241 250 ksort($c_metrics); 251 $const_metric_info_loop = array(); 242 252 foreach ($c_metrics as $name => $v ) 243 253 { 244 $tpl->newBlock("const_metric_info"); 245 $tpl->assign("name", $name); 246 $tpl->assign("value", "$v[VAL] $v[UNITS]"); 247 } 254 $const_info = array(); 255 $const_infp["name"] = $name; 256 $const_info["value"] = "$v[VAL] $v[UNITS]"; 257 $const_metric_info_loop[] = $const_info; 258 } 259 $tpl_data->assign("const_metric_info", $const_metric_info_loop ); 248 260 } 249 261 … … 252 264 { 253 265 ksort($g_metrics); 266 $vol_metric_info_loop = array(); 254 267 255 268 $i = 0; 256 269 foreach ( $g_metrics as $name => $v ) 257 270 { 258 $tpl->newBlock("vol_metric_info"); 259 $tpl->assign("graphargs", $v[graph]); 260 $tpl->assign("alt", "$hostname $name"); 261 if($i++ %2) 262 { 263 $tpl->assign("br", "<BR>"); 264 } 265 } 266 } 271 $metric_info = array(); 272 $metric_info["graphargs"] = $v[graph]; 273 $metric_info["alt"] = "$hostname $name"; 274 $vol_metric_info_loop[] = $metric_info; 275 } 276 $tpl_data->assign("vol_metric_info", $vol_metric_info_loop ); 277 } 278 $dwoo->output($tpl, $tpl_data); 267 279 } 268 280 -
branches/0.4/web/addons/job_monarch/libtoga.php
r752 r759 751 751 $metrics[$hostname]['last_reported']['VAL'] = $attrs['REPORTED']; 752 752 $metrics[$hostname]['last_reported']['TYPE'] = "string"; 753 $metrics[$hostname]['last_reported_timestamp']['NAME'] = "REPORTED TIMESTAMP";754 $metrics[$hostname]['last_reported_timestamp']['VAL'] = $attrs['REPORTED'];755 $metrics[$hostname]['last_reported_timestamp']['TYPE'] = "uint32";756 753 $metrics[$hostname]['ip_address']['NAME'] = "IP"; 757 754 $metrics[$hostname]['ip_address']['VAL'] = $attrs['IP']; -
branches/0.4/web/addons/job_monarch/templates/host_view.tpl
r737 r759 2 2 <TR> 3 3 <TD COLSPAN="2" BGCOLOR="#EEEEEE" ALIGN="CENTER"> 4 <FONT SIZE="+2">{ host} Overview</FONT>4 <FONT SIZE="+2">{$host} Overview</FONT> 5 5 </TD> 6 6 </TR> … … 9 9 <TD ALIGN="LEFT" VALIGN="TOP"> 10 10 11 <IMG SRC="{ node_image}" HEIGHT="60" WIDTH="30" ALT="{host}" BORDER="0">12 { node_msg}11 <IMG SRC="{$node_image}" HEIGHT="60" WIDTH="30" ALT="{$host}" BORDER="0"> 12 {$node_msg} 13 13 <P> 14 14 … … 18 18 </TR> 19 19 20 <!-- START BLOCK : string_metric_info --> 20 {loop $string_metric_info} 21 21 <TR> 22 <TD CLASS=footer WIDTH=30%>{ name}</TD><TD>{value}</TD>22 <TD CLASS=footer WIDTH=30%>{$name}</TD><TD>{$value}</TD> 23 23 </TR> 24 <!-- END BLOCK : string_metric_info --> 24 {/loop} 25 25 26 26 <TR><TD> </TD></TR> … … 30 30 </TR> 31 31 32 <!-- START BLOCK : const_metric_info --> 32 {loop $const_metric_info} 33 33 <TR> 34 <TD CLASS=footer WIDTH=30%>{ name}</TD><TD>{value}</TD>34 <TD CLASS=footer WIDTH=30%>{$name}</TD><TD>{$value}</TD> 35 35 </TR> 36 <!-- END BLOCK : const_metric_info --> 36 {/loop} 37 37 38 38 <TR><TD> </TD></TR> … … 40 40 <TR> 41 41 <TD COLSPAN=2 CLASS=title> 42 <a href="../../host_gmetrics.php?c={ cluster_url}&h={host}">Gmetrics</a>42 <a href="../../host_gmetrics.php?c={$cluster_url}&h={$host}">Gmetrics</a> 43 43 </TD> 44 44 </TR> 45 45 </TABLE> 46 46 47 <a href="./?c={ cluster}&h={host}">48 <IMG SRC="./image.php?c={ cluster}&h={host}&j_view=hostimage" BORDER=0>47 <a href="./?c={$cluster}&h={$host}"> 48 <IMG SRC="./image.php?c={$cluster}&h={$host}&j_view=hostimage" BORDER=0> 49 49 </a> 50 50 <hr> … … 53 53 54 54 <TD ALIGN="CENTER" VALIGN="TOP" WIDTH="395"> 55 <IMG ALT="{cluster_url} LOAD" 56 SRC="./graph.php?g=load_report&z=overview-medium&c={cluster_url}&{graphargs}"> 57 <IMG ALT="{cluster_url} MEM" 58 SRC="./graph.php?g=mem_report&z=overview-medium&c={cluster_url}&{graphargs}"> 59 <IMG ALT="{cluster_url} CPU" 60 SRC="./graph.php?g=cpu_report&z=overview-medium&c={cluster_url}&{graphargs}"> 61 <IMG ALT="{cluster_url} NETWORK" 62 SRC="./graph.php?g=network_report&z=overview-medium&c={cluster_url}&{graphargs}"> 63 <IMG ALT="{cluster_url} PACKETS" 64 SRC="./graph.php?g=packet_report&z=overview-medium&c={cluster_url}&{graphargs}"> 65 55 <div id="monarchimage"> 56 <IMG ALT="{$cluster_url} LOAD" SRC="./graph.php?g=load_report&z=overview-medium&c={$cluster_url}&{$graphargs}" WIDTH=381 HEIGHT=148> 57 <IMG ALT="{$cluster_url} MEM" SRC="./graph.php?g=mem_report&z=overview-medium&c={$cluster_url}&{$graphargs}" WIDTH=381 HEIGHT=148> 58 <IMG ALT="{$cluster_url} CPU" SRC="./graph.php?g=cpu_report&z=overview-medium&c={$cluster_url}&{$graphargs}" WIDTH=381 HEIGHT=148> 59 <IMG ALT="{$cluster_url} NETWORK" SRC="./graph.php?g=network_report&z=overview-medium&c={$cluster_url}&{$graphargs}" WIDTH=381 HEIGHT=148> 60 <IMG ALT="{$cluster_url} PACKETS" SRC="./graph.php?g=packet_report&z=overview-medium&c={$cluster_url}&{$graphargs}" WIDTH=381 HEIGHT=148> 61 </div> 66 62 </TD> 67 63 </TR> … … 72 68 <TR> 73 69 <TD CLASS=title> 74 { host} <strong>graphs</strong>75 last <strong>{ range}</strong>76 sorted <strong>{ sort}</strong>70 {$host} <strong>graphs</strong> 71 last <strong>{$range}</strong> 72 sorted <strong>{$sort}</strong> 77 73 </TD> 78 74 </TR> … … 84 80 <TD> 85 81 86 <!-- START BLOCK : vol_metric_info --> 87 <IMG ALT="{alt}" SRC="./graph.php?{graphargs}">{br} 88 <!-- END BLOCK : vol_metric_info --> 82 <div id="monarchimage"> 83 {loop $vol_metric_info} 84 <IMG ALT="{$alt}" SRC="./graph.php?{$graphargs}" WIDTH=381 HEIGHT=148> 85 {/loop} 86 </div> 89 87 90 88 </TD>
Note: See TracChangeset
for help on using the changeset viewer.