Projet

Général

Profil

Paste
Télécharger au format
Statistiques
| Branche: | Révision:

root / plugins / lustre / lustre_df_inodes @ b3ac5125

Historique | Voir | Annoter | Télécharger (1,84 ko)

1
#!/usr/bin/perl
2
# -*- perl -*-
3

    
4
=head1 NAME
5

    
6
lustre_df_inodes - Plugin to monitor Lustre 1.8.x (cluster FS) storage objects MDT,OST's 
7
usage inodes in percents
8

    
9
=head1 CONFIGURATION
10
Path to lfs binary. Configuration is done through $lfs_bin variable, for example
11
by default $lfs_bin = "/usr/bin/lfs", see below.
12

    
13
=head1 NOTES
14

    
15
Monitoring node - lustre client with mounted lustre
16

    
17
=head1 VERSION
18

    
19
  $Id: lustre_df_inodes,v 1.3 2011/03/01 10:39:58 fenix Exp $
20

    
21
=head1 AUTHOR
22

    
23
Ropchan Sergey <fenix.serega@gmail.com>
24

    
25
=head1 LICENSE
26

    
27
GPLv2
28

    
29
=cut
30

    
31
use Munin::Plugin;
32

    
33
my $lfs_bin = "/usr/bin/lfs";
34

    
35
if ($ARGV[0] and $ARGV[0] eq "autoconf") {
36
    if (-r $lfs_bin) {
37
	print "yes\n";
38
	exit 0;
39
    } else {
40
	print "no ($lfs_bin found)\n";
41
	exit 0;
42
    }
43
}
44

    
45
my @output = `$lfs_bin df -i`;
46

    
47
if ($ARGV[0] and $ARGV[0] eq "config") {
48
    print "graph_title Lustre cluster storage objects inodes usage in percent\n";
49
    print "graph_args --base 1000\n";
50
    print "graph_vlabel % usage\n";
51
    print "graph_scale no\n";
52
    print "graph_category lustre\n";
53

    
54
    &print_labels;
55

    
56
    exit 0;
57
}
58

    
59
sub print_labels {
60
    for $_ (@output) {
61
	#storage objects
62
        if (/^\S+\s+\S+\s+\S+\s+\S+\s+(\d+)\%\s+\S+\[(.*)\:(\d+)\]/i) {
63
		my $name = $2.$3;
64
                print $name.".label ", $name, "\n";
65
	        print $name.".min 0\n";
66
		print_thresholds($name,undef,undef,99,100);
67
        }
68
     }
69
                print "summary.label summary", "\n";
70
                print "summary.min 0\n";
71
                print_thresholds("summary",undef,undef,95,98);
72
}
73

    
74
&print_values;
75

    
76
sub print_values {
77
    for $_ (@output) {
78
	#storage objects
79
	if (/^\S+\s+\S+\s+\S+\s+\S+\s+(\d+)\%\s+\S+\[(.*)\:(\d+)\]/i) {
80
		my $name = $2.$3;
81
		print $name.".value ", $1, "\n";
82
        }
83

    
84
	#summanary info
85
	if (/^filesystem summary\:\s+\S+\s+\S+\s+\S+\s+(\d+)\%\s+\S+\s/i) {
86
		print "summary.value ", $1, "\n";
87
	}
88
    }
89
}
90