for my $box (@servers) { my $ssh = Net::OpenSSH->new($box, user => $user, password => $password); if ($ssh->error) { warn "unable to connect to $box"; next; } for my $certfile (@certfiles) { my $output = $ssh->capture('openssl', 'x509', '-in', "/etc/pki/tls/$certfile", '-noout', '-subject', '-hash', '-enddate'); unless ($output =~ /notAfter=(\S+)/) { warn "expiration data not found in $box:$certfile" next; } my $notAfter = $1; ... } }
In reply to Re: RFC - PERL SCRIPT TO SSH MULTIPLE SERVER NODES, CHECKS OF SSL CERTIFICATES EXPIRY AND EMAIL TO ROOT
by salva
in thread RFC - PERL SCRIPT TO SSH MULTIPLE SERVER NODES, CHECKS OF SSL CERTIFICATES EXPIRY AND EMAIL TO ROOT
by Zeeshan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |