Skip to content

Commit

Permalink
master: munin-limits: open the data file based on hostname, not alias.
Browse files Browse the repository at this point in the history
When using notify_alias with a hostname, we only want to send the
different name to the notification, but we still should open the data
file for the real hostname.
  • Loading branch information
Flameeyes committed Oct 3, 2012
1 parent 11bbbd1 commit e47faf9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions master/lib/Munin/Master/LimitsOld.pm
Expand Up @@ -277,7 +277,8 @@ sub get_full_group_path {
sub process_service {
my $hash = shift || return;
my $hobj = get_host_node($hash);
my $host = get_notify_name($hobj);
my $host = munin_get_node_name($hobj);
my $hostalias = get_notify_name($hobj);
my $service = munin_get_node_name($hash);
my $hparentobj = munin_get_parent($hobj);
my $parent = munin_get_node_name($hobj);
Expand All @@ -296,12 +297,12 @@ sub process_service {
$hash->{'fields'} = join(' ', map {munin_get_node_name($_)} @$children);
$hash->{'plugin'} = $service;
$hash->{'graph_title'} = get_full_service_name($hash);
$hash->{'host'} = $host;
$hash->{'host'} = $hostalias;
$hash->{'group'} = get_full_group_path($hparentobj);
$hash->{'worst'} = "ok";
$hash->{'worstid'} = 0 unless defined $hash->{'worstid'};

my $state_file = sprintf ('%s/state-%s-%s.storable', $config->{dbdir}, $hash->{group}, $hash->{host});
my $state_file = sprintf ('%s/state-%s-%s.storable', $config->{dbdir}, $hash->{group}, $host);
DEBUG "[DEBUG] state_file: $state_file";
my $state = munin_read_storable($state_file) || {};

Expand Down

0 comments on commit e47faf9

Please sign in to comment.