There's a plethora of ways to get license information, as Marcel pointed out, through $SYSTEM.License.  The online class reference show the methods and queries, with sample code, available to invoke:

From a command-line (list instance name(s) running, i.e., CACHE) that can be setup to run as a secure remote procedure call; or what we do is have scripts that feed back this data to our Nagios monitor for hosts/instances:

$ ccontrol all
$ ccontrol stat CACHE -a0 -L1

Hope this helps.