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

Adding updated FILECOUNT check used in bluestreak ionmx monitoring.

git-svn-id: https://labs.omniti.com/resmon/trunk@98 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55
parent 09340b7c
No related branches found
No related tags found
No related merge requests found
package Resmon::Module::FILECOUNT;
use Resmon::ExtComm qw/cache_command/;
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'};
my $hlimit = $arg->{'hard_limit'};
my $slimit = $arg->{'soft_limit'};
my $output = cache_command("ls $dir | wc -l",30);
chomp($output);
if ($output > $hlimit) {
return "BAD", "$output files";
} elsif ($output > $slimit) {
return "WARNING", "$output files";
} else {
return "OK", "$output 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