mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 22:25:23 +00:00
Removed deprecated hadoop command for hdfs
Made hdfs user configurable (FIXME: user plugin.conf)
This commit is contained in:
parent
2771a20fcb
commit
9d5a111982
1 changed files with 3 additions and 2 deletions
|
@ -15,11 +15,12 @@
|
||||||
use strict;
|
use strict;
|
||||||
use File::Basename qw(basename);
|
use File::Basename qw(basename);
|
||||||
|
|
||||||
my $type = &getType($0);
|
my $hdfs_user = "hdfs";
|
||||||
|
|
||||||
#
|
#
|
||||||
# main
|
# main
|
||||||
#
|
#
|
||||||
|
my $type = &getType($0);
|
||||||
if ($ARGV[0]) {
|
if ($ARGV[0]) {
|
||||||
if ($ARGV[0] eq "autoconf") {
|
if ($ARGV[0] eq "autoconf") {
|
||||||
print "yes\n";
|
print "yes\n";
|
||||||
|
@ -95,7 +96,7 @@ sub getCapacity {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getStatistics {
|
sub getStatistics {
|
||||||
open(DFSADMIN, "hadoop dfsadmin -report|") || die("Cannot open dfsadmin: $!");
|
open(DFSADMIN, "su $hdfs_user -c 'hdfs dfsadmin -report'|") || die("Cannot open dfsadmin: $!");
|
||||||
while(defined(my $line = <DFSADMIN>)) {
|
while(defined(my $line = <DFSADMIN>)) {
|
||||||
chomp($line);
|
chomp($line);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue