One-liner (Bash) to show the licensing table on Check Point Gaia systems.
Login to be able to copy the full code!
In expert mode run:
echo;echo "Licensing table";lic=$(cpstat os -f licensing);echo "$(echo "$lic"|grep "|ID";echo "$lic"|grep "|"|sed '1d'|sed 's/Not Entitled.*/None|0/;'|awk -F"|" '{if($5!=0){print "|"$2"|"$3"|"$4"|"strftime("%c",$5)"|"$6"|"$7"|"$8"|"$9"|"}else{print "|"$2"|"$3"|"$4"|-|"$6"|"$7"|"$8"|"$9"|"}}'|sort -k1)"|sed '1,2 i\|(|%|%|%|%|%|%|%|)|'|column -t -s'|'|sed '/(.*)/ s/./-/g'|sed 's/\bNone\b/\x1b[1;31m&\x1b[m/g;s/\bEvaluation\b/\x1b[1;36m&\x1b[m/g;s/\bEntitled\b/\x1b[1;32m&\x1b[m/g;';echo;echo "$lic"|grep :|grep -v "xpiration\|ctivation";echo -n "Support expiration: ";date -d @$(echo "$lic"|grep :|grep xpiration|awk '{print $NF}') 2>/dev/null;[ $? == 1 ] && echo;echo "$lic"|grep :|tail -n1;unset lic
Integrated with our ccc script.