Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: RFC - PERL SCRIPT TO SSH MULTIPLE SERVER NODES, CHECKS OF SSL CERTIFICATES EXPIRY AND EMAIL TO ROOT

by salva (Monsignor)
on May 09, 2012 at 08:04 UTC ( #969574=note: print w/ replies, xml ) Need Help??


in reply to RFC - PERL SCRIPT TO SSH MULTIPLE SERVER NODES, CHECKS OF SSL CERTIFICATES EXPIRY AND EMAIL TO ROOT

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; ... } }


Comment on Re: RFC - PERL SCRIPT TO SSH MULTIPLE SERVER NODES, CHECKS OF SSL CERTIFICATES EXPIRY AND EMAIL TO ROOT
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://969574]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-09-02 21:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (29 votes), past polls