mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
updated to user the perl munin module and user config from plugin-conf
This commit is contained in:
parent
4682e4fee4
commit
10dc32cd07
1 changed files with 10 additions and 2 deletions
|
@ -9,13 +9,21 @@
|
|||
# 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 $hdfs_user = "hdfs";
|
||||
|
||||
#
|
||||
# main
|
||||
|
@ -96,7 +104,7 @@ sub getCapacity {
|
|||
}
|
||||
|
||||
sub getStatistics {
|
||||
open(DFSADMIN, "sudo -u $hdfs_user hdfs dfsadmin -report|") || die("Cannot open dfsadmin: $!");
|
||||
open(DFSADMIN, "hdfs dfsadmin -report|") || die("Cannot open dfsadmin: $!");
|
||||
while(defined(my $line = <DFSADMIN>)) {
|
||||
chomp($line);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue