====== Licence ====== Vymazání prošlých licencí: ./bin64/licencec -deleteexpired Zobrazení počtu licencí: ./bin64/licencec -list | cut -b 14-22 | sort | uniq -c Zobrazení počtu licencí (jen neomezené): ./bin64/licencec -list | grep '30.12.1899' | cut -b 14-22 | sort | uniq -c Zobrazení počtu licencí z licenčního souboru: cut -d '#' -f 1 obis.lic | sort | uniq -c Zobrazení vyčerpaných licencí **user/scripts/licence.sql**: select distinct modul, count(modul) as obsazeno from licence l2 where (select count(*) from licence l1 where l1.modul=l2.modul and l1.idvyridil is null)=0 group by 1; Vícenasobně přihlášený uživatelé: ./bin64/licencec -listusers | cut -f1 -d$'\t' | sort | uniq -c | grep -v '^[ ]*1' Záznam využití licencí **user/scripts/licencecount.sql**: set heading; select distinct count(modul) as obsazeno, modul, 'casova' as typ, CURRENT_TIMESTAMP from licence l2 where l2.datumdo>0 and l2.idvyridil is not null group by 2,3,4 ; select distinct count(modul) as obsazeno, modul, 'plna' as typ, CURRENT_TIMESTAMP from licence l2 where l2.datumdo=0 and l2.idvyridil is not null group by 2,3,4 ; Kontrolní script spuštěný každou hodinu **user/scripts/licence.sh**: #!/bin/bash . `dirname $0`/setenv.sh $ROOTDIR/bin64/licencec -freeall $FIREBIRD/bin/isql -u $ISC_USER -p $ISC_PASSWORD -input $ROOTDIR/user/scripts/licencecount.sql $SERVER:$DATABASEPATH/licence.fdb >> $ROOTDIR/log/licence.log $ROOTDIR/bin64/licencec -listusers | cut -f1 -d$'\t' | sort | uniq -c | grep -v '^[ ]*1' | cut -b 9-16 > /tmp/$$ if [ -s /tmp/$$ ]; then $ROOTDIR/bin64/licencec -listusers | grep -f /tmp/$$ | sort >>$ROOTDIR/log/licence-multi.log fi rm /tmp/$$ Neaktivni uživatelé: select idvyridil, jmeno, idskupina, heslo from common_uzivatele u where not exists (select iduzivatele from common_syslog s where s.datum>CURRENT_DATE-365 and s.druh='login' and s.iduzivatele=u.idvyridil) and coalesce(heslo,'')<>'disable';