Changeset 3408
- Timestamp:
- 03/10/10 14:22:28 (2 years ago)
- Files:
-
- branches/1.4-stable/node/lib/Munin/Node/Server.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.4-stable/node/lib/Munin/Node/Server.pm
r3164 r3408 24 24 25 25 # Services that require the server to support multigraph plugins. 26 my @multigraph_services;26 my (@multigraph_services, @dirtyconfig_services); 27 27 28 28 # Which hosts this node's services applies to. Typically this is the … … 90 90 || $config->{fqdn}; 91 91 92 # hostname checks are case insensitive, so store everything in lowercase 93 $node = lc($node); 94 92 95 print STDERR "\tAdding to node $node\n" if $config->{DEBUG}; 93 96 push @{$nodes{$node}}, $service; … … 95 98 # Note any plugins that require particular server capabilities. 96 99 if (grep /^multigraph\s+/, @response) { 97 print STDERR "\tAdding to multigraph plugins\n" 98 if $config->{DEBUG}; 100 print STDERR "\tAdding to multigraph plugins\n" if $config->{DEBUG}; 99 101 push @multigraph_services, $service; 102 } 103 if (grep /^[A-Za-z0-9_]+\.value /, @response) { 104 # very dirty plugins -- they do a dirtyconfig even when 105 # "not allowed" by their environment. 106 print STDERR "\tAdding to dirty plugins\n" if $config->{DEBUG}; 107 push @dirtyconfig_services, $service; 100 108 } 101 109 } … … 213 221 my ($session, $server_capabilities) = @_; 214 222 215 my @node_cap = qw( multigraph ); 223 my @node_cap = qw/ 224 multigraph 225 dirtyconfig 226 /; 227 216 228 $session->{server_capabilities} = { 217 229 map { $_ => 1 } split(/ /, $server_capabilities) 218 230 }; 231 232 $ENV{MUNIN_CAP_DIRTYCONFIG} = 1 if ($session->{server_capabilities}{dirtyconfig}); 219 233 220 234 _net_write($session, sprintf("cap %s\n",join(" ", @node_cap))); … … 297 311 298 312 if (exists $nodes{$node}) { 299 # remove any plugins that require capabilities the server doesn't provide300 313 my @services = @{$nodes{$node}}; 314 315 # remove any plugins that require capabilities the master doesn't support 301 316 @services = Munin::Node::Utils::set_difference(\@services, \@multigraph_services) 302 317 unless $session->{server_capabilities}{multigraph}; 318 @services = Munin::Node::Utils::set_difference(\@services, \@dirtyconfig_services) 319 unless $session->{server_capabilities}{dirtyconfig}; 303 320 304 321 _net_write($session, join(" ", @services));
