Forum Discussion
arpydays
Sep 26, 2018Nimbostratus
This might get you started, it checks for any clientssl or serverssl profiles in all VSs then dumps any certs names from those profiles. Once you have the output you can sort and remove duplicates. Haven't used it anger so test it out first, v11+
!/bin/bash
for d in `tmsh -q -c "cd /;show ltm virtual recursive profiles" | grep '^ | Ltm::\(ClientSSL\|ServerSSL\)' | awk '{print $4}'`
do
tmshout=$(tmsh -q -c "cd /; list ltm profile client-ssl $d" 2>/dev/null | egrep -i '^ {4}(cert|chain) ' |awk '!/none/ {print $2}')
[[ "$tmshout" ]] || {
tmshout=$(tmsh -q -c "cd /; list ltm profile server-ssl $d" 2>/dev/null | egrep -i '^ {4}(cert|chain) ' |awk '!/none/ {print $2}')
}
[[ -z "$tmshout" ]] || echo "$tmshout"
done
bash ./activecerts.sh > activecerts.txt
bash sort -u -o activecerts.txt activecerts_sorted.txt