mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51: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
|
# Symlink this file to hadoop_hdfs_block or hadoop_hdfs_capacity to get block
|
||||||
# or capacity informations about the DFS.
|
# 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>
|
# Author: KARASZI Istvan <muninexchange@spam.raszi.hu>
|
||||||
#
|
#
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use File::Basename qw(basename);
|
use File::Basename qw(basename);
|
||||||
|
use Munin::Plugin;
|
||||||
|
|
||||||
my $hdfs_user = "hdfs";
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# main
|
# main
|
||||||
|
@ -96,7 +104,7 @@ sub getCapacity {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub getStatistics {
|
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>)) {
|
while(defined(my $line = <DFSADMIN>)) {
|
||||||
chomp($line);
|
chomp($line);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue