Skip to content
Snippets Groups Projects
Commit a71565ce authored by Mark Harrison's avatar Mark Harrison
Browse files

Adding large files module, used on pbx

git-svn-id: https://labs.omniti.com/resmon/trunk@124 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55
parent 634e1234
No related branches found
No related tags found
No related merge requests found
package Resmon::Module::LARGEFILES;
use Resmon::Module;
use vars qw/@ISA/;
@ISA = qw/Resmon::Module/;
sub handler {
my $arg = shift;
my $os = $arg->fresh_status();
return $os if $os;
my $dir = $arg->{'object'};
opendir(DIR, $dir);
my @bigfiles = grep { my @fileinfo = stat; $fileinfo[7] > $arg->{'limit'} } readdir(DIR);
closedir(DIR);
if (scalar(@bigfiles) > 0) {
return $arg->set_status("BAD(large files exist)");
} else {
return $arg->set_status("OK(no large files)");
}
}
1;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment