Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
due_to_source_code_changing_2 [2013/07/26 14:32] noskov |
due_to_source_code_changing_2 [2021/09/14 14:55] jrutte02 removed |
||
---|---|---|---|
Line 2: | Line 2: | ||
<file php maintenance_conf.php> | <file php maintenance_conf.php> | ||
<? | <? | ||
- | $maint_name = " | + | $maint_name = " |
- | | + | |
- | | + | $computer_metrics = array( |
- | | + | " |
- | | + | "mem", |
- | | + | "cpu" |
- | | + | ); |
- | | + | |
- | | + | $maint_rrdfile |
- | | + | " |
- | | + | |
- | | + | " |
- | | + | " |
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ) | ||
+ | |||
+ | ); | ||
+ | |||
+ | $mgroup_metrics = array( | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ), | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | ) | ||
+ | |||
+ | ); | ||
+ | |||
+ | function add_ipmi_metrics ($metrics, $rrddir){ | ||
+ | $alledateien = scandir($rrddir); | ||
+ | foreach ($alledateien as $datei) { // Ausgabeschleife | ||
+ | if (substr_compare($datei," | ||
+ | $dateiinfo = pathinfo($rrddir."/" | ||
+ | if($dateiinfo[' | ||
+ | $metrics[$dateiinfo[' | ||
+ | $metrics[$dateiinfo[' | ||
+ | $metrics[$dateiinfo[' | ||
+ | $metrics[$dateiinfo[' | ||
+ | $metrics[$dateiinfo[' | ||
+ | $metrics[$dateiinfo[' | ||
+ | # | ||
+ | } | ||
+ | } | ||
+ | }; | ||
+ | return $metrics; | ||
+ | } | ||
+ | |||
+ | function add_ipmi_metrics_cview($hostname, | ||
+ | $alledateien = scandir($rrddir); | ||
+ | foreach ($alledateien as $datei) { // Ausgabeschleife | ||
+ | if (substr_compare($datei," | ||
+ | $dateiinfo = pathinfo($rrddir."/" | ||
+ | if($dateiinfo[' | ||
+ | $metrics[$hostname][$dateiinfo[' | ||
+ | $metrics[$hostname][$dateiinfo[' | ||
+ | $metrics[$hostname][$dateiinfo[' | ||
+ | $metrics[$hostname][$dateiinfo[' | ||
+ | $metrics[$hostname][$dateiinfo[' | ||
+ | $metrics[$hostname][$dateiinfo[' | ||
+ | # | ||
+ | } | ||
+ | } | ||
+ | }; | ||
+ | return $metrics; | ||
+ | } | ||
+ | ?> | ||
</ | </ | ||
- | in the <GANGLIA HOME>/ | + | in the <GANGLIA HOME>/ |
| | ||
- | **pumpdp_report.php** | + | 4241 Aug 13 18:27 clcpairflow_report.php |
- | **pumptemp_report.php** | + | 4247 Aug 13 18:27 clcpwaterflow_report.php |
- | **rows_report.php** | + | 3011 Feb 17 2010 cpu_report.php |
- | **rowscool_report.php** | + | 4388 Aug 6 17:06 cputemp_report.php |
- | **clcpwaterflow_report.php** | + | 1481 Feb 17 2010 load_report.php |
+ | 2284 Feb 17 2010 mem_report.php | ||
+ | 3659 Aug 14 11:55 metric.php | ||
+ | 6481 Jul 18 16:50 my_report.php | ||
+ | 1109 Jul 19 11:52 network_report.php | ||
+ | 1107 Feb 17 2010 packet_report.php | ||
+ | 4369 Jul 19 16:12 pump1_report.php | ||
+ | 4561 Jul 24 14:38 pumpdp_report.php | ||
+ | 4752 Jul 24 16:34 pumptemp_report.php | ||
+ | 4079 Aug 13 18:26 rows_report.php | ||
+ | 4154 Aug 13 18:25 rowscool_report.php | ||
+ | 4089 Aug 13 18:26 rowsfan_report.php | ||
+ | 6481 Feb 17 2010 sample_report.php | ||
+ | |||
+ | |||
+ | correction of the file metric.php in order to take new DS in to account: | ||
+ | <file metric.php> | ||
+ | ... | ||
+ | $DSname=" | ||
+ | //# the actual graph... | ||
+ | if (substr_compare($metricname," | ||
+ | $DSname=" | ||
+ | $series | ||
+ | $series .= " | ||
+ | $series .= ": | ||
+ | ... | ||
+ | </ | ||
**in the file conf.php (in "/ | **in the file conf.php (in "/ | ||
<code php> | <code php> | ||
+ | ... | ||
include_once " | include_once " | ||
+ | ... | ||
+ | # Set timezone | ||
+ | date_default_timezone_set ( ' | ||
+ | ... | ||
</ | </ | ||
Line 47: | Line 232: | ||
<TD ROWSPAN=2 ALIGN=" | <TD ROWSPAN=2 ALIGN=" | ||
| | ||
+ | <table cellspacing=1 cellpadding=1 width=100% border=0> | ||
+ | <!-- START BLOCK : graph_group --> | ||
+ | < | ||
+ | < | ||
<!-- START BLOCK : metric_graphs --> | <!-- START BLOCK : metric_graphs --> | ||
- | | + | |
- | | + | |
- | | + | ALT=" |
- | </A> | + | |
<!-- END BLOCK : metric_graphs --> | <!-- END BLOCK : metric_graphs --> | ||
+ | </ | ||
+ | </ | ||
+ | <!-- END BLOCK : graph_group --> | ||
+ | </ | ||
| | ||
</ | </ | ||
Line 80: | Line 273: | ||
| | ||
if ($name == $maint_name){ | if ($name == $maint_name){ | ||
- | | + | foreach ($mgroup_metrics as $mname => &$mgrp) { |
- | | + | $hostname = $mname; |
- | | + | $tpl-> |
- | | + | |
- | | + | $tpl-> |
- | | + | |
- | | + | $tpl-> |
- | | + | $tpl-> |
+ | $tpl-> | ||
+ | | ||
+ | $tpl-> | ||
+ | $tpl-> | ||
+ | } | ||
} | } | ||
- | |||
} else { | } else { | ||
if ($cluster_load) | if ($cluster_load) | ||
Line 95: | Line 292: | ||
."< | ."< | ||
| | ||
+ | $tpl-> | ||
| | ||
Line 106: | Line 304: | ||
} | } | ||
} | } | ||
- | + | ||
- | + | ||
- | if(isset($base64img)) { | + | |
- | $tpl-> | + | |
- | } | + | |
- | } | + | |
- | else | + | |
- | { | + | |
- | $tpl-> | + | |
- | $tpl-> | + | |
- | $tpl-> | + | |
- | if ($localtime) | + | |
- | | + | |
- | . date(" | + | |
- | } | + | |
- | } | + | |
... | ... | ||
</ | </ | ||
Line 131: | Line 314: | ||
$tpl-> | $tpl-> | ||
</ | </ | ||
+ | |||
+ | in order to list new IPMI metrics additionally in the cluster overview page the function start_cluster was changed to ganglia.php | ||
+ | <file changing ganglia.php> | ||
+ | ... | ||
+ | function start_cluster ($parser, $tagname, $attrs) | ||
+ | { | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | { | ||
+ | case " | ||
+ | preamble($attrs); | ||
+ | break; | ||
+ | case " | ||
+ | $self = $attrs[' | ||
+ | $grid = $attrs; | ||
+ | break; | ||
+ | |||
+ | case " | ||
+ | $cluster = $attrs; | ||
+ | break; | ||
+ | |||
+ | case " | ||
+ | $hostname = $attrs[' | ||
+ | |||
+ | if (host_alive($attrs, | ||
+ | { | ||
+ | isset($cluster[' | ||
+ | $cluster[' | ||
+ | $hosts_up[$hostname] = $attrs; | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | isset($cluster[' | ||
+ | $cluster[' | ||
+ | $hosts_down[$hostname] = $attrs; | ||
+ | } | ||
+ | # Pseudo metrics - add useful HOST attributes like gmond_started & last_reported to the metrics list: | ||
+ | $metrics[$hostname][' | ||
+ | $metrics[$hostname][' | ||
+ | $metrics[$hostname][' | ||
+ | $metrics[$hostname][' | ||
+ | $metrics[$hostname][' | ||
+ | $metrics[$hostname][' | ||
+ | $metrics[$hostname][' | ||
+ | $metrics[$hostname][' | ||
+ | $metrics[$hostname][' | ||
+ | $metrics[$hostname][' | ||
+ | $metrics[$hostname][' | ||
+ | $metrics[$hostname][' | ||
+ | |||
+ | /* Addition of IPMI metrics */ | ||
+ | $rrddir = " | ||
+ | $metrics=add_ipmi_metrics_cview($hostname, | ||
+ | # | ||
+ | |||
+ | break; | ||
+ | |||
+ | case " | ||
+ | $metricname = $attrs[' | ||
+ | $metrics[$hostname][$metricname] = $attrs; | ||
+ | break; | ||
+ | |||
+ | | ||
+ | break; | ||
+ | } | ||
+ | } | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | in order to see the IPMI metrics in the host overview the file host_view.php was changed as following: | ||
+ | <file host_view.php> | ||
+ | ... | ||
+ | $g_metrics_group = array(); | ||
+ | |||
+ | /* Addition of IPMI metrics */ | ||
+ | $rrddir = " | ||
+ | $metrics=add_ipmi_metrics($metrics, | ||
+ | ... | ||
+ | </ |