#!/usr/bin/perl #BEGIN { push @INC, '/usr/local/tc-scripts/lustrestats' } use lib '/usr/local/tc-scripts/lustrestats'; use strict; use Switch; use warnings; use Lustrestats qw(parse_stats parse_single parse_exportstats); my $i; my $namespace="lustre"; my $lustre_type="oss"; #or oss, or client, or router my $server_name=`hostname`; chomp $server_name; #do client stats my @exportstats = `/usr/sbin/lctl get_param obdfilter.*OST*.exports.*@*.stats`; print ("0 lustre_exportstats "); my $formatted_exstats = parse_exportstats(\@exportstats); $i=1; foreach my $line (@$formatted_exstats) { #only need this for the first line. if ($i != 1) { print "|"; } my @linearray = split (" ",$line); my $exportname = $linearray[1]; $exportname =~ s/\./_/g; print("$linearray[0].${exportname}.$linearray[2]=$linearray[3]"); $i=2; } #close up the stats line print " Lustre Export Statistics\n";