1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

Removed deprecated hadoop command for hdfs

Made hdfs user configurable (FIXME: user plugin.conf)
This commit is contained in:
tsaavik 2013-12-20 10:18:46 -08:00
parent 2771a20fcb
commit 9d5a111982

View file

@ -15,11 +15,12 @@
use strict;
use File::Basename qw(basename);
my $type = &getType($0);
my $hdfs_user = "hdfs";
#
# main
#
my $type = &getType($0);
if ($ARGV[0]) {
if ($ARGV[0] eq "autoconf") {
print "yes\n";
@ -95,7 +96,7 @@ sub getCapacity {
}
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>)) {
chomp($line);