Projet

Général

Profil

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

root / plugins / other / lustre_df_indodes @ 48d917a5

Historique | Voir | Annoter | Télécharger (1,76 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 AUTHOR
18

    
19
Ropchan Sergey <fenix.serega@gmail.com>
20

    
21
=head1 LICENSE
22

    
23
GPLv2
24

    
25
=cut
26

    
27
use Munin::Plugin;
28

    
29
my $lfs_bin = "/usr/bin/lfs";
30

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

    
41
my @output = `$lfs_bin df -i`;
42

    
43
&print_values;
44

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

    
52
    &print_labels;
53

    
54
    exit 0;
55
}
56

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

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

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