Skip to content

Commit

Permalink
Main: Bugfix with graphs using both "graph_sums" and data aliases.
Browse files Browse the repository at this point in the history
  • Loading branch information
jomono committed Jan 5, 2005
1 parent bd8b955 commit e377652
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ munin (work)
* Main: Fix bug which lead to some graphs failing with STACK error.
* Main: Added limit message option "strtrunc".
* Main: "contacts" can now be set to "none".
* Main: Bugfix with graphs using both "graph_sums" and data aliases.
* Plugins: generic/sendmail_mail{stats,traffic} updated.
* Plugins: Made generic/samba more portable (fixes by Nicolas Stransky).
* Plugins: Fixed typo in generic/loggrep breaking implicit labeling.
Expand Down
6 changes: 6 additions & 0 deletions server/Munin.pm.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ package Munin;
# $Id$
#
# $Log$
# Revision 1.42 2005/01/05 17:43:34 jimmyo
# Main: Bugfix with graphs using both "graph_sums" and data aliases.
#
# Revision 1.41 2004/12/25 18:56:59 jimmyo
# Allow dots in PNG paths (patch by Jacques Caruso).
#
Expand Down Expand Up @@ -294,6 +297,9 @@ sub munin_draw_field {
my $service = shift;
my $field = shift;

$field =~ s/=.*//;

print "DEBUG: munin_draw_field: Checking $service -> $field: " . &munin_get_bool_val ($node->{client}->{$service}->{$field.".graph"}, 1) . ".\n" if $DEBUG;;
return 0 if (exists $node->{client}->{$service}->{$field.".skipdraw"});
return (&munin_get_bool_val ($node->{client}->{$service}->{$field.".graph"}, 1));
}
Expand Down
13 changes: 9 additions & 4 deletions server/munin-graph.in
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
# $Id$
#
# $Log$
# Revision 1.49 2005/01/05 17:43:34 jimmyo
# Main: Bugfix with graphs using both "graph_sums" and data aliases.
#
# Revision 1.48 2005/01/04 08:38:51 jimmyo
# Fix bug which lead to some graphs failing with STACK error.
#
Expand Down Expand Up @@ -709,9 +712,11 @@ sub single_value
my $graphable = 0;
if (!defined $node->{client}->{$service}->{"graphable"})
{
foreach my $field (keys %{$node->{client}->{$service}})
# foreach my $field (keys %{$node->{client}->{$service}})
foreach my $field (&get_field_order ($node, $config, $domain, $host, $service))
{
if ($field =~ /^([^\.]+)\.label/)
print "DEBUG: single_value: Checking field \"$field\".\n" if $DEBUG;
if ($field =~ /^([^\.]+)\.label/ or $field =~ /=/)
{
$graphable++ if &munin_draw_field ($node, $service, $1);
}
Expand Down Expand Up @@ -1158,7 +1163,7 @@ sub process_node {
{
if ($rrd_sum[$index] =~ /^(--vertical-label|-v)$/)
{
(my $label = $node->{client}->{$service}->{graph_vlabel}) =~ s/\$\{scale\}/$sumtimes{$time}[0]/g;
(my $label = $node->{client}->{$service}->{graph_vlabel}) =~ s/\$\{graph_period\}/$sumtimes{$time}[0]/g;
splice (@rrd_sum, $index, 2, ("--vertical-label", $label));
$index++;
$labelled++;
Expand All @@ -1171,7 +1176,7 @@ sub process_node {
push @defined, "x$fname";
my @replace;

if (defined ($node->{client}->{$service}->{$fname.".type"}) and $node->{client}->{$service}->{$fname.".type"} ne "GAUGE")
if (!defined ($node->{client}->{$service}->{$fname.".type"}) or $node->{client}->{$service}->{$fname.".type"} ne "GAUGE")
{
if ($time eq "week")
{ # Every plot is half an hour. Add two plots and multiply, to get per hour
Expand Down

0 comments on commit e377652

Please sign in to comment.