How do we delete device(s) in UIM/Nimsoft (in an user friendly way)?
The latest available doc/discussion explained that this is a multi step procedure, certainly if you want also to delete the related QoS data.
Attached zip contains a Perl script: nimsoft_delete_device.pl that will remove the device by a discovery_server callback + remove all qos data
-h: regex device to be deleted string
-s: simulate run (y,n) default: y
-l: list detailed list of selected qos to delete (y,n) default: n
- sql query: "select name, cs_key, nimbus_type from CM_COMPUTER_SYSTEM order by name"
- match the regex server list entered via -h on the column: "name". This means that you can have multiple matches for the same server name if this table contains multiple entries for the same server (like this can happens)
- all matches on: cs_keys are put in a comma separated string
- callback probe discovery_server remove_master_devices_by_cskeys with the list of cs_keys
- sql query: "SELECT origin, robot, probe, qos, source, target, r_table, h_table, v_table, table_id FROM S_QOS_DATA"
- match the regex server list with the "source" column and create 3 sql delete statements for every encountered qos:
- DELETE from 'RN_QOS_DATA_0023' where table_id='nnnn'
- DELETE from 'HN_QOS_DATA_0023' where table_id='nnnn'
- DELETE from S_QOS_DATA where table_id ='nnnn'
The script was written for Windows and MSSQL (mySQL code is there but must be tested) with Strawberry Perl
In the zip file there is also a doc file that contains more info (you will need to change a file: nimsoft_generic.dat with server & user settings)
compiled version is also included (compiled with Strawberry PP 64bit))