Managing license with lmf on Tru64

Recently I had to retrieve all the Tru64 licenses (OSF-BASE, OSF_SRV, OSF-USR…) on my old bunch of Apha Servers, in order to save them (in case of need).

Récemment j’ai du récupérer toutes les licences Tru64 (OSF-BASE, OSF_SRV, OSF-USR…) sur mes vieux serveurs Alpha, pour les sauvegarder (en cas de besoin).

This is how you manage Tru64 licenses:

Voici comment administrer les licences Tru64 :

# lmf list
Product                   Status                     Users: Total      Active
OSF-SVR                   active                            unlimited
OSF-BASE                  active                            unlimited
OSF-USR                   active                            4          0

“lmf list full” to get the full information, for instance :

“lmf list full” pour avoir la liste complète des informations sur les licences, par ex :

Product Name: OSF-BASE
Producer: DEC
Issuer: DEC
Authorization Number: XXX-XX-2004MAY18-XXX
Number of units: XX
Product Release Date:
Key Termination Date:
Availability Table Code: A
Activity Table Code:
Product Token:
License status: active
Cancellation Date:
Revision Number: 0
Cache Total Units: XX
Activity Charge: 0

To save your licenses on files you need “Product Name”, “Producer” and “Authorization Number” fields.
Then you have to run :

Pour sauvegarder vos licences dans des fichiers il faut les champs “Product Name”, “Producer” and “Authorization Number” et lancer :

lmf issue /tmp/license_file <Product Name> <Producer> <Authorization number>

The license is now in the file. If you run “lmf list” one license will be missing.
So you have to register again the license with the command:

La licence est maintenant contenue dans le fichier. Si vous lancez « lmf list », une des licences est manquante.

Il faut donc enregistrer à nouveau la licence avec la commande :

lmfregister - < /tmp/license_file

and enable the license :

et activer la licence :

lmf reset

This is a quick shell script I wrote in order to save some time.

Voici un shell script que j’ai rapidement écrit pour gagner du temps.

The 3 needed fields for all licenses are extracted in a variable. I use only the first 3 fields of the variable corresponding to a license. With those 3 fields I extract the license in a file (/tmp directory).

I’m doing the extraction until there are no more licenses on the server, then I use the files to register again the licenses and enable them.

J’extrais les 3 champs nécessaires de chaque licence dans une seule variable et je traite les 3 premiers champs qui correspondent à une licence.  Grace aux 3 champs j’extrais la licence dans un fichier dans le répertoire /tmp.

Cette opération est effectuée jusqu’à ce qu’il n’y ait plus de licences sur le serveur. Ensuite j’utilise les fichiers pour remettre les licences et les réactiver.

#Initiate the loop
while [ "$A" != "" ]
# get license list in one line
A=$(lmf list full |grep -E "Product Name|Producer|Authorization Number" |awk -F":" '{print $2}')
# if no license is found it's the end
[[ "$A" = "" ]] && break
PRODUCT=$(echo $A |awk '{print $1}')
PRODUCER=$(echo $A |awk '{print $2}')
AUTH=$(echo $A |awk '{print $3}')
echo "License file is /tmp/${HST}_${PRODUCT}_${AUTH}"
#transfert the lisence to the file
lmf issue /tmp/${HST}_${PRODUCT}_${AUTH} ${PRODUCT} ${PRODUCER} ${AUTH}
#now the licenses are on files
#then you have to push again the licenses to the system
cd /tmp/
ls -1 `hostname`*|while read LINE
echo "-> register of license $LINE"
lmf register - < $LINE
#enable the licenses
lmf reset

Author: Jey

Leave a Reply

Your email address will not be published. Required fields are marked *