SA support tip: How to list all of the certificates with their expiration dates (306 Views)
Reply
HP Expert
molinabro1
Posts: 501
Registered: ‎05-09-2007
Message 1 of 3 (306 Views)
Accepted Solution

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.
Acclaimed Contributor
Dennis Handly
Posts: 25,292
Registered: ‎03-06-2006
Message 2 of 3 (289 Views)

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.)

HP Expert
molinabro1
Posts: 501
Registered: ‎05-09-2007
Message 3 of 3 (282 Views)

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.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.