Skip to content

Commit 88e6b96

Browse files
committed
Remove "ignore" value for "use_node_name"
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.
1 parent 33cb535 commit 88e6b96

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

lib/Munin/Master/Node.pm

+14-6
Original file line numberDiff line numberDiff line change
@@ -255,16 +255,24 @@ sub list_plugins {
255255
my $use_node_name = defined($self->{configref}{use_node_name})
256256
? $self->{configref}{use_node_name}
257257
: $config->{use_node_name};
258-
my $host = Munin::Master::Config->_parse_bool($use_node_name, 0)
259-
? $self->{node_name}
260-
: $self->{host};
261258

262-
my $host_list = ($use_node_name && $use_node_name eq "ignore") ? "" : $host;
263-
$self->_node_write_single("list $host_list\n");
259+
# "use_node_name" was allowed to be "ignore" for some time. This usage is discouraged and
260+
# treated as "yes", since the effect of "ignore" and "yes" did not differ.
261+
$use_node_name = "yes" if ($use_node_name eq "ignore");
262+
263+
my $list_request_description;
264+
if (Munin::Master::Config->_parse_bool($use_node_name, 0)) {
265+
$self->_node_write_single("list\n");
266+
$list_request_description = "local services";
267+
} else {
268+
$self->_node_write_single("list $self->{host}\n");
269+
$list_request_description = "services for '$self->{host}'";
270+
}
271+
264272
my $list = $self->_node_read_single();
265273

266274
if (not $list) {
267-
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.";
275+
WARN "[WARNING] Config node $self->{host} listed no $list_request_description. Please see http://munin-monitoring.org/wiki/FAQ_no_graphs for further information.";
268276
}
269277

270278
return split / /, $list;

0 commit comments

Comments
 (0)