| App-MadEye documentation | Contained in the App-MadEye distribution. |
App::MadEye::Plugin::Agent::SMTPTLS - check smtptls.
type: map
mapping:
target:
type: seq
required: yes
sequence:
- type: str
port:
required: no
type: int
timeout:
required: no
type: int
Tokuhiro Matsuno
| App-MadEye documentation | Contained in the App-MadEye distribution. |
package App::MadEye::Plugin::Agent::SMTPTLS; use strict; use warnings; use App::MadEye::Plugin::Agent::Base; use Net::SMTP::TLS; sub is_dead { my ( $self, $host ) = @_; my $conf = $self->config->{config}; my $port = $conf->{port} || 25; my $timeout = $conf->{timeout} || 3; eval { my $smtptls = Net::SMTP::TLS->new( $host, Hello => $host, Port => $port, NoTLS => 1, Timeout => $timeout, ); }; if ($@) { return "dead: $@"; } else { return; # alive! } } 1; __END__