Changeset 3406
- Timestamp:
- 03/08/10 15:24:59 (2 years ago)
- Files:
-
- trunk/node/lib/Munin/Node/Server.pm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/node/lib/Munin/Node/Server.pm
r3404 r3406 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 … … 89 89 || (split /\s+/, ($host_name || ''))[1] 90 90 || $config->{fqdn}; 91 92 # hostname checks are case in-sensitive, 93 # so store everything in lowercase 94 $node = lc($node); 91 92 # hostname checks are case insensitive, so store everything in lowercase 93 $node = lc($node); 95 94 96 95 print STDERR "\tAdding to node $node\n" if $config->{DEBUG}; … … 99 98 # Note any plugins that require particular server capabilities. 100 99 if (grep /^multigraph\s+/, @response) { 101 print STDERR "\tAdding to multigraph plugins\n" 102 if $config->{DEBUG}; 100 print STDERR "\tAdding to multigraph plugins\n" if $config->{DEBUG}; 103 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; 104 108 } 105 109 } … … 217 221 my ($session, $server_capabilities) = @_; 218 222 219 my @node_cap = qw( multigraph ); 223 my @node_cap = qw/ 224 multigraph 225 dirtyconfig 226 /; 227 220 228 $session->{server_capabilities} = { 221 229 map { $_ => 1 } split(/ /, $server_capabilities) 222 230 }; 231 232 $ENV{MUNIN_CAP_DIRTYCONFIG} = 1 if ($session->{server_capabilities}{dirtyconfig}); 223 233 224 234 _net_write($session, sprintf("cap %s\n",join(" ", @node_cap))); … … 301 311 302 312 if (exists $nodes{$node}) { 303 # remove any plugins that require capabilities the server doesn't provide304 313 my @services = @{$nodes{$node}}; 314 315 # remove any plugins that require capabilities the master doesn't support 305 316 @services = Munin::Node::Utils::set_difference(\@services, \@multigraph_services) 306 317 unless $session->{server_capabilities}{multigraph}; 318 @services = Munin::Node::Utils::set_difference(\@services, \@dirtyconfig_services) 319 unless $session->{server_capabilities}{dirtyconfig}; 307 320 308 321 _net_write($session, join(" ", @services));
