Skip to content

Commit

Permalink
Remove "ignore" value for "use_node_name"
Browse files Browse the repository at this point in the history
The additional value "ignore" was added in dd4cbb5.

It caused the following "list" commands to be sent to the node:
* "yes" -> "list $self->{node_name}"
* "ignore" -> "list "
* "no" -> "list $self->{host}"
* any other value -> "list $self->{host}"

The above "$self->{node_name}" is the name advertised by the node during
the opening of the connection.
"$self->{host}" is the name of the node section in the master
configuration.

The new behaviour is the following:
* "yes" -> "list"
* "ignore" -> "list"
* "no" -> "list $self->{host}"
* any other value -> "list $self->{host}"

This behaviour has the same effect as before, as the request for "list"
(without a specific node name) is handley by munin-node exactly, as if
its "node_name" is supplied.
  • Loading branch information
sumpfralle committed Dec 15, 2018
1 parent b80800e commit 7a28b54
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions lib/Munin/Master/Node.pm
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,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 $host_list = ($use_node_name && $use_node_name eq "ignore") ? "" : $host;
$self->_node_write_single("list $host_list\n");
# "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");

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 $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

0 comments on commit 7a28b54

Please sign in to comment.