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

Pgrep module has been converted

git-svn-id: https://labs.omniti.com/resmon/branches/resmon2@345 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55
parent c9453a88
No related branches found
No related tags found
No related merge requests found
package Resmon::Module::PGREP;
use Resmon::ExtComm qw/cache_command/;
use vars qw/@ISA/;
@ISA = qw/Resmon::Module/;
sub handler {
my $arg = shift;
my $proc = $arg->{'object'};
my $args = join(' ',$arg->{'arg0'},$arg->{'arg1'},$arg->{'arg2'});
$args =~s/\s+$//;
$proc .= " $args" if $args;
my $output = cache_command("pgrep -f -l '$proc' | grep -v pgrep | head -1",
180);
if($output) {
chomp $output;
return("OK(pid:$output)");
}
return("BAD(no output)");
};
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