How to determine when a Spectrum Model was deleted
Release : All Spectrum Releases.
Component : Spectrum Core / SpectroSERVER
Option One:
Within Spectrum OneClick check for event id 0x10202 against the target device:
0x10202 - A model has been destroyed. The model was {m} of type {t} destroyed by {u}.
Once the device is destroyed, you can no longer select it in OneClick or in CLI or REST as the model handle no longer exists for this device. The event is logged and stored to the DDM database (mysql) and can be viewed there.
Navigate in a command line shell to $SPECROOT/mysql/bin:
On Windows:
./mysql -uroot -p<password> ddmdb;
On Linux:
./mysql --defaults-file=../my-spectrum.cnf -uroot -p<password> ddmdb;
To show the time and model name of a deleted device in the mysql database you can use any of these:
SELECT model.model_name, DATE_FORMAT(FROM_UNIXTIME(event.utime), '%Y-%m-%d %H:%i:%s') AS readable_utime
FROM model
JOIN event ON model.model_h = event.model_h
WHERE type=0x10202;
SELECT m.model_name, concat("0x",hex( e.type)) as type, FROM_UNIXTIME(e.utime) as time from event e inner join model m on m.model_h=e.model_h where e.ty
pe=0x10202 order by time desc;
SELECT HEX(m.model_h), m.mtype_h, u.user_name, m.landscape_h, m.model_name, e.type from model m, event e, user_def u where e.model_h=m.model_h and e.user_key=u.user_key and e.type=0x10202 and e.utime > UNIX_TIMESTAMP('2024-01-01 00:00:00') and e.utime < UNIX_TIMESTAMP('2024-02-20 23:59:59') and u.user_name <> '' order by m.model_name;
Option Two:
Within Jaspersoft Reporting create an Ad Hoc Report to query the Asset Domain data to view Model Handle Destroy Time information.
Selecting to "Store Event in Historical Database" will send the event to the DDM\MySQL DB.
Without this option checked the event is transient and not being written to the DDM\MySQL DB and the above options will not be applicable.
By enabling this option if a model is deleted you will have an audit trail of the event.
For Global Collections the standard destroy event shows System. Since GCs are global, there is a Master model. When the GC is destroyed, event 0x10a03 is generated noting the "master model was destroyed". This is not logged by default although it looks like the code might actually log it anyway.