218 |
} elsif ( $method =~ m{^/favicon.ico} ) { |
} elsif ( $method =~ m{^/favicon.ico} ) { |
219 |
print $send "HTTP/1.0 200 OK\r\nContent-Type: image/vnd.microsoft.icon\r\n\r\n", read_file( 'artwork/favicon.ico' ); |
print $send "HTTP/1.0 200 OK\r\nContent-Type: image/vnd.microsoft.icon\r\n\r\n", read_file( 'artwork/favicon.ico' ); |
220 |
return 1; |
return 1; |
221 |
|
} elsif ( $method =~ m{/nodes} ) { |
222 |
|
to_all { ping => 1 }; |
223 |
|
my @proc = ( 'MemTotal', 'MemFree', 'Buffers', 'Cached', 'VmSize', 'VmPeak' ); |
224 |
|
print $send "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n", |
225 |
|
'<table><tr><th>', join('</th><th>', 'node', 'ip', @proc), '</th></tr>'; |
226 |
|
foreach my $node ( sort { |
227 |
|
$info->{host}->{$a} cmp $info->{host}->{$b} || # ip |
228 |
|
$a <=> $b # node |
229 |
|
} keys %{$info->{proc}} ) { |
230 |
|
print $send '<tr><td>', join('</td><td align=right>', |
231 |
|
$node, $info->{host}->{$node}, map { |
232 |
|
my $kb = $info->{proc}->{$node}->{$_}; |
233 |
|
$kb =~ s/\s+kb//i; $kb; |
234 |
|
} @proc ), '</td><tr>'; |
235 |
|
} |
236 |
|
print $send '</table>'; |
237 |
|
return 1; |
238 |
} |
} |
239 |
|
|
240 |
my $refresh = $param->{refresh}; |
my $refresh = $param->{refresh}; |
335 |
} |
} |
336 |
print $send qq|<tt$attr>$node</tt>\n|; |
print $send qq|<tt$attr>$node</tt>\n|; |
337 |
} |
} |
338 |
|
print $send qq|<a href=/nodes/>details</a>|; |
339 |
|
|
340 |
print $send qq|<h1>Shards</h1><ul>|; |
print $send qq|<h1>Shards</h1><ul>|; |
341 |
foreach my $path ( glob '/tmp/sack/*' ) { |
foreach my $path ( glob '/tmp/sack/*' ) { |
403 |
Storable::store_fd( $response, $sock ); |
Storable::store_fd( $response, $sock ); |
404 |
} elsif ( $data->{ping} ) { |
} elsif ( $data->{ping} ) { |
405 |
my $port = $data->{port}; |
my $port = $data->{port}; |
406 |
delete( $info->{pending}->{$port} ) if $info->{pending}->{$port} eq 'forked'; |
delete( $info->{pending}->{$port} ) if defined $info->{pending}->{$port} && $info->{pending}->{$port} eq 'forked'; |
407 |
$session->{port}->{$port} = $sock; |
$session->{port}->{$port} = $sock; |
408 |
foreach my $name ( keys %{$data->{proc}} ) { |
foreach my $name ( keys %{$data->{proc}} ) { |
409 |
if ( $name eq 'loadavg' ) { |
if ( $name eq 'loadavg' ) { |