2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Merge pull request #414 from tsaavik/master

Updated to work without using deprecated hadoop command and allows setting of hadoop admin user via plugin-conf
This commit is contained in:
Steve Schnepp 2014-01-02 03:45:27 -08:00
commit a30e9ddcc9

View File

@ -9,17 +9,26 @@
# Symlink this file to hadoop_hdfs_block or hadoop_hdfs_capacity to get block
# or capacity informations about the DFS.
#
#
# Needs following minimal configuration in plugin-conf.d/munin-node:
# [hadoop_hdfs_block]
# user hdfs
#
# [hadoop_hdfs_capacity]
# user hdfs
#
# Author: KARASZI Istvan <muninexchange@spam.raszi.hu>
#
use strict;
use File::Basename qw(basename);
use Munin::Plugin;
my $type = &getType($0);
#
# main
#
my $type = &getType($0);
if ($ARGV[0]) {
if ($ARGV[0] eq "autoconf") {
print "yes\n";
@ -95,9 +104,12 @@ sub getCapacity {
}
sub getStatistics {
open(DFSADMIN, "hadoop dfsadmin -report|") || die("Cannot open dfsadmin: $!");
open(DFSADMIN, "hdfs dfsadmin -report|") || die("Cannot open dfsadmin: $!");
while(defined(my $line = <DFSADMIN>)) {
chomp($line);
if ($line =~ /-------------------------------------------------/) {
last
}
if ($type eq "block") {
&getBlock($line);