Delete a JSON schema imported using restmon
search cancel

Delete a JSON schema imported using restmon

book

Article ID: 191816

calendar_today

Updated On: 11-21-2023

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

I've created a schema and imported on UIM to monitor a product using restmon.

Now I need delete this imported schema to import a new one with other metrics and using other name 

How can I delete it?

Environment

Release : UIM 20.x - Tested up to 20.4 CU6

Component : UIM - MON_CONFIG_SERVICE

Cause

Guidance

Resolution

1. Run the following SQL query to find the template ids (there will generally be a minimum of two templates ids per package - one for the Setup component, and one for the metrics components):

Select *from SSRV2Template

OR

Select *from SSRV2Template where description like '%XXXX%'

Example:
Select *from SSRV2Template where description like '%IDESSENTIALS%'

Take note of templateids to use in step 2.


2. Then run the following SQL delete commands:

delete from SSRV2PackageTemplate where template in (417,418)
delete from ssrv2container where template in (417,418)
delete from ssrv2removal where template in (417,418)
delete from ssrv2configvalue where field in (select id from ssrv2field where template in (417,418))
delete from ssrv2field where template in (417,418)
delete from ssrv2profile where template in (417,418)
delete from ssrv2template where templateid in (417,418)
delete from SSRV2ProbeTemplatesPackage where probe_name like '%weather%' (as you will keep the probe, you will not need to run this command)

Also delete the template folder from <\Nimsoft\probes\service\mon_config_service\migrators\probes>

NOTE: the probe name here in the 3rd query "IDESSENTIALS" actually come from the title line of the .json file (the schema name)

Additional Information

NOTE: If after deleting a schema, and trying to reload the same schema again it gets stuck at the "Validate and deploy custom schema" step (at the "schema validation & probe package deployment" sub-step) please try to run the above cleaning by executing the queries again, restart the OC Wasp and try loading the schema again in OC/Restmon