Forum Discussion
Mchelle_181998
Cirrus
Oct 20, 2017report for all SSL
Looking how to create a more formatted report of all SSL certificates
I run command tmsh list sys file ssl-cert all > /ssl.txt which then I import into excel. However the ssl.txt each ssl certi...
- Oct 20, 2017
How would I put this to an output text file
!/bin/bashPARTITIONS=( $(tmsh list auth partition one-line | sed -e 's/ //g' | grep -oP '(?<=partition)[^{]+' -) )
for partition in ${PARTITIONS[*]}; do tmsh -q -c "cd /$partition; list sys file ssl-cert" done
Kevin_K_51432
Nov 22, 2017Historic F5 Account
Greetings,
You'll need to output this using the "one-line" option. Then using awk, extract each interesting column.The $ represents the position within the column (minus one).
I'm extracting those mentioned in the description:
tmsh -c "cd /; list sys file ssl-cert /*/* one-line" | awk '{print $4, $6, $7, $14, $15, $32, $33}'
Common/mykey2.crt certificate-key-size 2048 expiration-date 1542902160 serial-number 249033360
Common/mykey3.crt certificate-key-size 2048 expiration-date 1542902167 serial-number 249033367
Common/mykey4.crt certificate-key-size 2048 expiration-date 1542902173 serial-number 249033373
Common/mykey.crt certificate-key-size 2048 expiration-date 1542901585 serial-number 249032785
Try running the command without the "| awk" filter to see the columns and then count over (minus one).
Hope this makes sense and is helpful!
KevinRecent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects