App-madeye
view release on metacpan or search on metacpan
lib/App/MadEye/Plugin/Agent/Perlbal.pm view on Meta::CPAN
my $timeout = $conf->{timeout} || 10;
my $sock = IO::Socket::INET->new(
PeerAddr => $host,
PeerPort => $port,
Timeout => $timeout,
) or return "cannot open socket";
$sock->write($req);
my $content = join '', <$sock>;
if ($content =~ m{Server: Perlbal.+<h1>404 - Not Found</h1>}s) {
return; # alive.
} else {
return "this is not a perlbal?\n\n$content";
}
}
1;
__END__
=for stopwords Perlbal
lib/App/MadEye/Plugin/Agent/SNMP/Process.pm view on Meta::CPAN
my $response = $session->get_table(
-baseoid => $hrSWRunPath,
) or die "cannot get a $_ : " . $session->error;
return $response;
}
);
if (first { $_ eq $process } values %$response) {
return; # alive
} else {
return "404 $process not found";
}
}
1;
__END__
=head1 NAME
App::MadEye::Plugin::Agent::SNMP::Process - monitoring process
lib/App/MadEye/Util.pm view on Meta::CPAN
my $proto = ref $target || $target;
my $parser = Pod::POM->new;
my $pom = $parser->parse(Class::Inspector->resolved_filename($proto));
if (my $schema_node = first { $_->title eq 'SCHEMA' } $pom->head1) {
my $schema_content = $schema_node->content;
$schema_content =~ s/^ //gm;
my $schema = YAML::Load($schema_content);
return $schema;
} else {
return; # 404 schema not found.
}
}
sub snmp_session {
my ($agent, $host, $callback, ) = @_;
my $community = $agent->config->{config}->{community} or die "missing community";
my $port = $agent->config->{config}->{port} || 161;
my $timeout = $agent->config->{config}->{timeout} || 10;
my $retries = $agent->config->{config}->{retries} || 1;
( run in 1.426 second using v1.01-cache-2.11-cpan-39bf76dae61 )