On Windows 2008 R2 (MSSQL backend) I logged in as SIDADM and ran the following:
saplikey -show (and -get) pf=<PROFIL> = unable to connect to DB
saplicense -show (and -test) pf=<PROFIL> = unable to connect to DB
Chances are its a SQL auth issue, I should also point out I am testing this on a 7.4 NW java stack.
But if this were to work you could schedule this to run daily and populate something to report the license status.
Or you could script it so that if it comes back with a temp/bad license to apply/install the new one from location xyz, at which point you just have to have the files sitting some where waiting for the script to find the issue with the licenses.