Skip to content

Commit

Permalink
fix ganglia-web issue ganglia#49 where host parameter is ignored by n…
Browse files Browse the repository at this point in the history
…agios/check_metric.php
  • Loading branch information
Scott Bessler committed Mar 6, 2012
1 parent 754a283 commit eee56db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nagios/check_metric.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
include_once $conf['gweb_root'] . "/get_ganglia.php";
# Massage the metrics to minimize the cache file by caching only attributes
# we care about
foreach ( $metrics as $host => $host_metrics ) {
foreach ( $metrics as $mhost => $host_metrics ) {
foreach ( $host_metrics as $name => $attributes ) {
$new_metrics[$host][$name]['VAL'] = $metrics[$host][$name]['VAL'];
if ( isset($metrics[$host][$name]['UNITS']) )
$new_metrics[$host][$name]['UNITS'] = $metrics[$host][$name]['UNITS'];
$new_metrics[$mhost][$name]['VAL'] = $metrics[$mhost][$name]['VAL'];
if ( isset($metrics[$mhost][$name]['UNITS']) )
$new_metrics[$mhost][$name]['UNITS'] = $metrics[$mhost][$name]['UNITS'];
}
}
file_put_contents($conf['nagios_cache_file'], serialize($new_metrics));
Expand Down

0 comments on commit eee56db

Please sign in to comment.