Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove possible "ignore" value from "use_node_name" #1140

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/Munin/Master/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ my %booleans = map {$_ => 1} qw(
tls_verify_certificate
update
use_node_name
use_default_node
);


Expand Down
22 changes: 11 additions & 11 deletions lib/Munin/Master/Node.pm
Original file line number Diff line number Diff line change
Expand Up @@ -255,24 +255,24 @@ sub list_plugins {
my $use_node_name = defined($self->{configref}{use_node_name})
? $self->{configref}{use_node_name}
: $config->{use_node_name};
my $host = Munin::Master::Config->_parse_bool($use_node_name, 0)
? $self->{node_name}
: $self->{host};

my $use_default_node = defined($self->{configref}{use_default_node})
? $self->{configref}{use_default_node}
: $config->{use_default_node};
# "use_node_name" was allowed to be "ignore" for some time. This usage is discouraged and
# treated as "yes", since the effect of "ignore" and "yes" did not differ.
$use_node_name = "yes" if ($use_node_name eq "ignore");

if (! $use_default_node && ! $host) {
die "[ERROR] Couldn't find out which host to list on $host.\n";
my $list_request_description;
if (Munin::Master::Config->_parse_bool($use_node_name, 0)) {
$self->_node_write_single("list\n");
$list_request_description = "local services";
} else {
$self->_node_write_single("list $self->{host}\n");
$list_request_description = "services for '$self->{host}'";
}

my $host_list = ($use_node_name && $use_node_name eq "ignore") ? "" : $host;
$self->_node_write_single("list $host_list\n");
my $list = $self->_node_read_single();

if (not $list) {
WARN "[WARNING] Config node $self->{host} listed no services for '$host_list'. Please see http://munin-monitoring.org/wiki/FAQ_no_graphs for further information.";
WARN "[WARNING] Config node $self->{host} listed no $list_request_description. Please see http://munin-monitoring.org/wiki/FAQ_no_graphs for further information.";
}

return split / /, $list;
Expand Down