Server Automation Practitioners Forum
Showing results for 
Search instead for 
Do you mean 

SA support tip: How to list all of the certificates with their expiration dates

SOLVED
Go to Solution
HPE Expert

SA support tip: How to list all of the certificates with their expiration dates

[ Edited ]

Have you ever wanted to list all SA certificates along with their expiration dates?  With this command you can do it:

 

 

 

find /var/opt/opsware/crypto/ \( -name "*.crt" -o -name "*.srv" -o -name "*.pem" -o -name "*.pk12" \) -exec bash -c "in=\$0;md5=\$( md5sum \$in| awk '{print \$1}');expire=\$( openssl x509 -in \$in -noout -enddate | awk -F= '{print \$2}' ); echo \$in,\$md5,\$expire" {} \;

 

 

Try it out, it´s pretty neat!

 

KM about this:

 

http://support.openview.hp.com/selfsolve/document/KM00511757



Ed Molina
HP Cloud Solution Support Engineer

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution. Also, if you liked this post please consider providing Kudos on the left side.
2 REPLIES
Acclaimed Contributor Acclaimed Contributor

Re: SA support tip: How to list all of the certificates with their expiration dates

Your example is missing find's trailing ";" as in: ... {} \;

 

(You can correct your example by using Post Options > Edit Reply.)

Highlighted
HPE Expert

Re: SA support tip: How to list all of the certificates with their expiration dates

Hello! I appreciate the observation, I fixed it now, thanks!



Ed Molina
HP Cloud Solution Support Engineer

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution. Also, if you liked this post please consider providing Kudos on the left side.