"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "master/lib/Munin/Master/GraphOld.pm" between
munin-2.0.66.tar.gz and munin-2.0.67.tar.gz

About: Munin is a tool for graphing all sorts of information about one or more servers and displaying it in a web interface (requires Perl and RRDTool).

GraphOld.pm  (munin-2.0.66):GraphOld.pm  (munin-2.0.67)
skipping to change at line 869 skipping to change at line 869
my @ret; my @ret;
my %keys; my %keys;
for my $order (@_) { for my $order (@_) {
(my $name = $order) =~ s/=.+//; (my $name = $order) =~ s/=.+//;
push @ret, $order unless ($keys{$name} ++); push @ret, $order unless ($keys{$name} ++);
} }
return @ret; return @ret;
} }
sub _sanitise_fieldname {
# http://munin-monitoring.org/wiki/notes_on_datasource_names
my ($name) = @_;
$name =~ s/^[^A-Za-z_]/_/;
$name =~ s/[^A-Za-z0-9_]/_/g;
return $name;
}
sub process_service { sub process_service {
my ($service) = @_; my ($service) = @_;
# See if we should skip the service # See if we should skip the service
return if (skip_service($service)); return if (skip_service($service));
# Make my graphs # Make my graphs
my $sname = munin_get_node_name($service); my $sname = munin_get_node_name($service);
my $skeypath = munin_get_keypath($service); my $skeypath = munin_get_keypath($service);
my $service_time = Time::HiRes::time; my $service_time = Time::HiRes::time;
skipping to change at line 1128 skipping to change at line 1138
$fielddraw $fielddraw
. ":g$rrdname" . ":g$rrdname"
. "#$colour" . ":" . "#$colour" . ":"
. escape($tmplabel) . escape($tmplabel)
. (" " x ($max_field_len + 1 - length $tmplabel))); . (" " x ($max_field_len + 1 - length $tmplabel)));
# Check for negative fields (typically network (or disk) traffic) # Check for negative fields (typically network (or disk) traffic)
if ($has_negative) { if ($has_negative) {
my $negfieldname my $negfieldname
= orig_to_cdef($service, munin_get($field, "negative")); = orig_to_cdef($service, munin_get($field, "negative"));
my $negfield = $service->{$negfieldname}; my $negfield = $service->{_sanitise_fieldname(munin_get($field, "neg ative"))};
if (my $tmpneg = munin_get($negfield, "realname")) { if (my $tmpneg = munin_get($negfield, "realname")) {
$negfieldname = $tmpneg; $negfieldname = $tmpneg;
$negfield = $service->{$negfieldname}; $negfield = $service->{$negfieldname};
} }
if (!@rrd_negatives) { if (!@rrd_negatives) {
# zero-line, to redraw zero afterwards. # zero-line, to redraw zero afterwards.
push(@rrd_negatives, "CDEF:re_zero=g$negfieldname,UN,0,0,IF"); push(@rrd_negatives, "CDEF:re_zero=g$negfieldname,UN,0,0,IF");
} }
skipping to change at line 1684 skipping to change at line 1694
sub graph_by_hour { sub graph_by_hour {
my $service = shift; my $service = shift;
return (munin_get($service, "graph_period", "second") eq "hour"); return (munin_get($service, "graph_period", "second") eq "hour");
} }
sub orig_to_cdef { sub orig_to_cdef {
my $service = shift; my $service = shift;
my $fieldname = shift; my $fieldname = shift;
my $original_fieldname = shift || $fieldname;
return unless ref($service) eq "HASH"; return unless ref($service) eq "HASH";
if (defined $service->{$fieldname} && defined $service->{$fieldname}->{"cdef _name"}) { if (defined $service->{$fieldname} && defined $service->{$fieldname}->{"cdef _name"}) {
return orig_to_cdef($service, $service->{$fieldname}->{"cdef_name"}); return orig_to_cdef($service, $service->{$fieldname}->{"cdef_name"}, $or
iginal_fieldname);
}
# For unknown reasons the sanitizing of fieldnames in the context of RRD fie
ld names is not
# applied consistently (maybe it should not be applied at all).
# Thus we need to apply it here in the same way, as it seems to be applied a
t other places.
if (_sanitise_fieldname($original_fieldname) ne $original_fieldname) {
return get_field_name(_sanitise_fieldname($fieldname));
} else {
return get_field_name($fieldname);
} }
return $fieldname;
} }
sub reset_cdef { sub reset_cdef {
my $service = shift; my $service = shift;
my $fieldname = shift; my $fieldname = shift;
return unless ref($service) eq "HASH"; return unless ref($service) eq "HASH";
if (defined $service->{$fieldname} && defined $service->{$fieldname}->{"c def_name"}) { if (defined $service->{$fieldname} && defined $service->{$fieldname}->{"c def_name"}) {
reset_cdef($service, $service->{$fieldname}->{"cdef_name"}); reset_cdef($service, $service->{$fieldname}->{"cdef_name"});
delete $service->{$fieldname}->{"cdef_name"}; delete $service->{$fieldname}->{"cdef_name"};
} }
 End of changes. 5 change blocks. 
3 lines changed or deleted 24 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)