A question that I receive with (almost) every client is: How do we delete device(s) in UIM/Nimsoft (in an user friendlly 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 tool: nimsoft_delete_device that will remove the device in
- via discovery_server probe callback (remove from usm)
- via hub probe callback (remove from IM)
- all related QoS data
- all related MCS\SSR QoS data
- all related alarms in nas_transaction_log and nas_transaction_summary
- via the nas probe callback (nameservice_delete)
-h: device(s) to delete
-o: filter on origin
-c: filter on dedicated
(Device, VirtualMachine, Host, HostSystem)
-r: enable regex expressions on flags -h,-o,-c (y,n) default: n
-q: delete QoS (y,n) default: y
(QoS will not be deleted if -c is used)
-i: delete in hub/IM (y,n) default: y
-a: delete alarm (y,n) default: y
-m: delete MCS/SSR QoS entries (y,n) default: n
-n: delete in NAS address table (y,n) default: y
-l: list detailed list of selected QoS to delete (y,n) default: n
-v: verbose on sql delete (y,n) default: y
-s: simulate run (y,n) default: y
Example: nimsoft_delete_device.exe -h"servername"
This will simulate the delete of the server "servername". If the simulation is ok for you, you can add: -s"n"
The script is written for Windows and MSSQL/mySQL and compiled via the pp option in Strawberry Perl. The package contains the .exe and .pl versions)
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)
- parameter -o makes it possible to filter on origin in regex format
- mssql trusted connection can be used
- mysql added
- delete alarms in nas_transaction_log and nas_transaction_summary
- delete mcs/ssr qos and definitions
- regex is now an option
- in the search of all robotnames the tool will only search the domain specified in the nimsoft_generic.dat file
- works now with MSSQL and MySQL
- Works now on Windows and Linux (tested on Centos7)
- included compiled version for Linux (.bin) and Windows (.exe) that should work on standalone servers (but with a robot installed)
- The step to delete the device in the robot table of the hub is now based on a simple SQL query instead of (time consuming) callbacks
- the -m option is modified to be compatible with UIM 8.51.
- delete device NAS addess table with the option -n
Comments and ideas are very welcome.
(this is , like all other user written tools, only an example tool that I tested as good as possible)
Note1: this version was fully tested on 8.4.7, 8.5 and 8.51
If you want to run it on older 8.x versions you must use the -m"n" parameter so that the tool will not try to use the MCS/SSR tables from 8.4
(tested with -m"n" on 8.1 and 8.31)
Note2: if you run the tool in non-simulation mode and receive an error like: "rc=2 err=communication error from nimNamedRequest " this is probably due to an error in defining the correct variable values (specially Case is important) for uim_domain, uim_hub or uim_robot in the file nimsoft_generic.dat. Try to use your values in the command:
pu -u administrator -p ?? /your_domain/your_hub/your_robot/discovery_server get_snmp_devices