due_to_source_code_changing_2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
due_to_source_code_changing_2 [2013/07/25 16:57]
noskov
— (current)
Line 1: Line 1:
-A few new configuration files were placed in the <GANGLIA HOME>/ directory with the following content: 
-<file php maintenance_conf.php> 
-   <?php 
-   $maint_name = "maintenance"; 
-   $computer_metrics = array( 
-     "load", 
-     "mem" 
-   ); 
-   $maintenance_metrics = array( 
-     "rows", 
-     "rowscool", 
-     "clcpwaterflow", 
-     "pumptemp", 
-     "pumpdp" 
-   ); 
-   ?> 
-</file>    
-in the <GANGLIA HOME>/graph.d/ directory (files archive {{:graph_d.zip|}}) 
-   
-   **pumpdp_report.php** 
-   **pumptemp_report.php** 
-   **rows_report.php** 
-   **rowscool_report.php** 
-   **clcpwaterflow_report.php** 
  
-**in the file conf.php (in "/etc/ganglia/") was inserted:** 
-<code php> 
-include_once "./maintenance_conf.php"; 
-</code> 
- 
-in the template file <GANGLIA HOME>/templates/default/meta_view.tpl the block "public" was changed: 
- 
-<code php> 
-... 
-<!-- START BLOCK : public --> 
- <TD ALIGN="LEFT" VALIGN="TOP"> 
-<table cellspacing=1 cellpadding=1 width="100%" border=0> 
- <tr><td>CPUs Total:</td><td align=left><B>{cpu_num}</B></td></tr> 
- <tr><td width="80%">Hosts up:</td><td align=left><B>{num_nodes}</B></td></tr> 
- <tr><td>Hosts down:</td><td align=left><B>{num_dead_nodes}</B></td></tr> 
- <tr><td>&nbsp;</td></tr> 
- <tr><td class=footer colspan=2>{cluster_load}</td></tr> 
- <tr><td class=footer colspan=2>{localtime}</td></tr> 
-</table> 
-  </TD> 
- 
-  <TD ROWSPAN=2 ALIGN="CENTER" VALIGN=top> 
-   
-  <!-- START BLOCK : metric_graphs --> 
-  <A HREF="{url}"> 
-   <IMG SRC="./graph.php?{graph_url}&g={metricname}_report&z=medium&r={range}" 
-       ALT="{name} Load" BORDER="0"> 
-  </A> 
-  <!-- END BLOCK : metric_graphs --> 
-   
-   </TD> 
-<!-- END BLOCK : public --> 
-... 
-</code> 
- 
-in the file <GANGLIA HOME>/meta_view.php the following was changed: 
-<code php public cluster code is altered> 
-... 
-foreach ( $sorted_sources as $source => $val ) 
-  { 
- 
-... 
-    if (!isset($private[$source]) or !$private[$source])  
-         { 
-            $tpl->assign("alt_view", "<FONT SIZE=\"-2\">$alt_url</FONT>"); 
-            # Each block has a different namespace, so we need to redefine variables. 
-            $tpl->newBlock("public"); 
-            if ($localtime) 
-               $tpl->assign("localtime",  "<font size=-1>Localtime:</font><br>&nbsp;&nbsp;"  
-                  . date("Y-m-d H:i", $localtime) ); 
-              
-             $tpl->assign("num_nodes", $grid[$source]["HOSTS_UP"] ); 
-             $tpl->assign("num_dead_nodes", $grid[$source]["HOSTS_DOWN"] ); 
-             
-             
-             if ($name == $maint_name){ 
-                 foreach ($maintenance_metrics as $g) { 
-                     $tpl->newBlock("metric_graphs"); 
-                      
-                     $tpl->assign("range", $range); 
-                     $tpl->assign("name", $name ); 
-                     $tpl->assign("url", "./graph.php?c=$cluster_url&amp;r=$range&amp;g=${g}_report&amp;z=large"); 
-                     $tpl->assign("graph_url", $graph_url); 
-                     $tpl->assign("metricname", $g); 
-                 } 
-                  
-             } else { 
-                 if ($cluster_load) 
-                     $tpl->assign("cluster_load", "<font size=-1>Avg Load (15, 5, 1m):</font>" 
-                                  ."<br>&nbsp;&nbsp;$cluster_load"); 
-                 $tpl->assign("cpu_num", $m["cpu_num"]['SUM']); 
-                 foreach ($computer_metrics as $g) { 
-                      
-                     $tpl->newBlock("metric_graphs"); 
-                      
-                     $tpl->assign("range", $range); 
-                     $tpl->assign("name", $name ); 
-                     $tpl->assign("url", $url); 
-                     $tpl->assign("graph_url", $graph_url); 
-                     $tpl->assign("metricname", $g); 
-                 } 
-             } 
-             
-             
-     if(isset($base64img)) { 
-                $tpl->assign("base64img", $base64img); 
-     } 
-         } 
-      else  
-         { 
-            $tpl->newBlock("private"); 
-            $tpl->assign("num_nodes", $grid[$source]["HOSTS_UP"] + $grid[$source]["HOSTS_DOWN"] ); 
-            $tpl->assign("cpu_num", $m["cpu_num"]['SUM']); 
-            if ($localtime) 
-               $tpl->assign("localtime", "<font size=-1>Localtime:</font><br>&nbsp;&nbsp;" 
-                  . date("Y-m-d H:i",$localtime)); 
-         } 
-   } 
-... 
-</code> 
-<code php> 
-</code> 
  • due_to_source_code_changing_2.1374764226.txt.gz
  • Last modified: 2013/07/25 16:57
  • by noskov