Stored Proc SSRV2GetProfileName doesn't return MCS profile name in UIM 9.02

book

Article ID: 130431

calendar_today

Updated On:

Products

DX Infrastructure Management NIMSOFT PROBES

Issue/Introduction

In UIM 9.02, when executing the store procedure SSRV2GetProfileName using the suppression key from cdm alarms it doesn't retur the name of the existing MCS Profile as expected. 
Example:
When invoking the SP with the suppkey from a disk alarm like "disk/C:\" the result is "Default Disk(s)". What is expected instead is the result of "C:\" as a profile exists in MCS for CDM Disk monitor. 

Environment

Release:
Component: UIMMCS

Resolution

Dev has made available a new store proc that works when suppression key is of format  'monitoringtype/ProfileName' 

---------SSRV2GetProfileName_New.sql -----------
 
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'SSRV2GetProfileName_New') AND type in (N'P', N'PC')) DROP PROCEDURE SSRV2GetProfileName_New;
GO
create procedure [dbo].[SSRV2GetProfileName_New] @supp_key NVARCHAR(MAX), 
@defaultCpuProfile NVARCHAR(MAX) = 'CPU Monitor', 
@defaultMemoryProfile NVARCHAR(MAX) = 'Memory Monitor', 
@defaultDiskProfile NVARCHAR(MAX) = 'Default Disk(s)' 
AS  
	DECLARE @MonType AS NVARCHAR(MAX),  
	@RemainingLine AS NVARCHAR(MAX),  
	@ProfileName AS NVARCHAR(MAX),  
	@foundIdx AS bigint  
        select @MonType = substring(@supp_key,0,charindex('/',@supp_key)) 
        select @RemainingLine = substring(@supp_key,CHARINDEX('/',@supp_key)+1,LEN(@supp_key)) 
        select @foundIdx = CHARINDEX('/',@supp_key) 
	if @foundIdx > 0  
	BEGIN  
		 select @ProfileName = @RemainingLine  
	END  
	ELSE  
	BEGIN  
		if @MonType = 'cpu'  
			select @ProfileName = @defaultCpuProfile  
		else  
		BEGIN  
			if @MonType = 'memory'  
				select @ProfileName = @defaultMemoryProfile  
			else  
				select @ProfileName = @defaultDiskProfile 
		END  
	END   
	select @ProfileName as profile 
GO

---------SSRV2GetProfileName_New.sql ------------

Additional Information

MCS Docs:
https://docops.ca.com/ca-unified-infrastructure-management/9-0-2/en/configuring-and-viewing-monitoring-data/the-unified-service-manager-portlet/monitoring-configuration-service/manage-monitoring-using-mcs-profile-types/

Attachments

1558537174473SSRV2GetProfileName_New.sql get_app