2 Replies Latest reply on Nov 3, 2015 10:00 AM by azabielski

    Entity Object ID's for Physical Disks

    azabielski

      Hello all i was just wondering if there were any plans in the works to update the tables for SRM to include URL's as well as EntityNetObjectId's for SRM Physical disks? We have some logic that links alerts and without this the logic fails. It would be also help for the physical disks to be "click-a-ble" and have a history or information about that single disk.

       

       

      EntityTypeEntityCaptionEntityDetailsUrlEntityNetObjectId
      Orion.SRM.Volumesvol_MEV01_H/Orion/View.aspx?NetObject=SMV:1455SMV:1455
      Orion.SRM.Volumesv_home/Orion/View.aspx?NetObject=SMV:136SMV:136
      Orion.SRM.PhysicalDisks0c.00.11NULL:
      Orion.SRM.PhysicalDisks0c.00.6NULL:
      Orion.SRM.PhysicalDisks0a.20.11NULL:
      Orion.SRM.PhysicalDisks0c.00.5NULL:
      Orion.SRM.PhysicalDisks0c.00.11NULL:
      Orion.SRM.PhysicalDisks0c.00.6NULL:
      Orion.SRM.PhysicalDisks0a.20.11NULL:
      Orion.SRM.PhysicalDisks0c.00.5NULL:

       

       

      See the NULL's and lack of ObjectID's

        • Re: Entity Object ID's for Physical Disks
          cvachovecj

          Hi,

           

          If I understand your request, what you want are more details to be polled about individual disks. Then, it would make sense to have a dedicated disk details view. In the current situation, all the information we poll about disks fits in the "Disks on this Array" resource.

           

          Disks-on-this-Array.png

           

          Edit: We do pull a few more details on the physical disks. They are available in the alerting and reporting schemas, but not shown in the default dashboard resources.

           

          Jiri

          • Re: Entity Object ID's for Physical Disks
            azabielski

            Yeah i found kinda of a hack way around it but it works..

             

            CREATE procedure [dbo].[sp_GetAllActiveAlerts]

            as

            begin

              declare @i int;

              declare @numrows int;

              declare @curNode int;

              declare @curAlert nvarchar(255);

              declare @object nvarchar(max);

              declare @entity varchar(255);

              declare @objectId nvarchar(255);

              declare @srmtable varchar(255);

              declare @srmCol nvarchar(255);

              declare @colParam nvarchar(500);

              declare @colquery nvarchar(max);

              declare @tblParam nvarchar(500);

              declare @tblQuery nvarchar(max);

              declare @all_active_alerts table (

              AlertDefID uniqueidentifier null,

              ObjectName nvarchar(50) null,

              EventID int null,

              Vendor nvarchar(255) null,

              NodeID int null,

              Status char(20) null,

              "Node Name" nvarchar(255) null,

              Serial nvarchar(1000) null,

              Message nvarchar(max) null,

              "Alert Type" nvarchar(255) null,

              EventTime datetime null,

              IP_Address nvarchar(50) null,

              CRM_Account nvarchar(4000) null

              );

              declare @tempTable table (

              id int Primary Key identity(1,1),

              alertId bigint,

              nodeid bigint,

              entity nvarchar(255),

              objectid nvarchar(255),

              fixedId bigint

              );

             

              insert @tempTable select aa.AlertActiveID,ao.RelatedNodeId,ao.EntityType,ao.EntityNetObjectId,REVERSE(SUBSTRING(REVERSE(ao.RealEntityUri),0,CHARINDEX('=',REVERSE(ao.RealEntityUri)))) as FixID from AlertActive as aa inner join AlertObjects as ao on aa.AlertObjectID = ao.AlertObjectID where aa.Acknowledged IS NULL

              set @numrows = (select COUNT(*) from @tempTable)

              set @i = 1

              if @numrows > 0

              while(@i <= @numrows)

              begin

              set @curNode = (select nodeid from @tempTable where id = @i)

              set @curAlert = (select alertId from @tempTable where id = @i)

              if (@curNode IS NOT NULL)

               begin

              insert @all_active_alerts

              select CAST(ahv.AlertRefID as uniqueidentifier) as AlertDefID

              ,ahv.ObjectType as ObjectName

              ,ahv.AlertHistoryID as EventID

              ,n.Vendor as Vendor

              ,n.NodeID as NodeID

              ,n.Status as Status

              ,n.Caption as 'Node Name'

              ,hw.ServiceTag as Serial

              ,SUBSTRING(ahv.Message,charindex(':', ahv.Message)+2,LEN(ahv.Message)) as Message

              ,ahv.EntityCaption as 'Alert Type'

              ,DateAdd(HH,-4,asv.TriggeredDateTime) as EventTime

              ,n.IP_Address as IP_Address

              ,n.CRM_Account as CRM_Account

              from AlertActive as asv WITH(NOLOCK)

              inner join (select MAX(CAST(AlertRefID as varchar(255)))AlertRefID,MAX(ObjectType)ObjectType,MAX(AlertHistoryID)AlertHistoryID,MAX(RelatedNodeId)RelatedNodeId,MAX(ActionTypeID)ActionTypeID,MAX(EventTypeWord)EventTypeWord,MAX(Message)Message,MAX(EntityCaption)EntityCaption,AlertActiveID from AlertHistoryView where ActionTypeID = 'WriteToNPMEventLog'

              and EventTypeWord = 'ActionSucceeded' Group by AlertActiveID) as ahv on (asv.AlertActiveID = ahv.AlertActiveID)

              inner join Nodes as n WITH(NOLOCK) on n.NodeID = ahv.RelatedNodeId

              Left outer join APM_HardwareInfo as hw WITH(NOLOCK) on hw.NodeID = n.NodeID

              WHERE

              n.Status <> 9

              and asv.AlertActiveID = @curAlert

              and ahv.AlertHistoryID > (select LastPulledEventID from LastAutoCasePull where id = 1);

               end

              if (@curNode IS NULL)

              begin

              declare @newCol nvarchar(255)

              create table #tmp (

              colName nvarchar(255) null

              )

             

             

              set @object = (select objectid from @tempTable where id = @i);

              set @entity = (select entity from @tempTable where id = @i);

              set @objectId = SUBSTRING(@object,CHARINDEX(':',@object)+1,len(@object));

              if (LEN(@objectId) <= 0)

              begin

              set @objectId = (select fixedId from @tempTable where id = @i);

              end

              set @srmtable = 'SRM_' + REVERSE(SUBSTRING(REVERSE(@entity),0,CHARINDEX('.',REVERSE(@entity))));

             

              select @colquery = N'select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = ''' + @srmtable + ''' and ORDINAL_POSITION = 1';

              SET @colParam = N'@retvalOUT nvarchar(255) OUTPUT';

              insert into #tmp (colName) exec sp_executesql @colquery, @colParam, @retvalOUT=@srmCol OUTPUT;

             

              set @newCol = (select colName from #tmp);

              select @tblQuery = N'select CAST(ahv.AlertRefID as uniqueidentifier) as AlertDefID,ahv.ObjectType as ObjectName,ahv.AlertHistoryID as EventID,n.Vendor as Vendor,n.StorageArrayID as NodeID,n.Status as Status,n.UserCaption as ''Node Name'',n.SerialNumber as Serial,SUBSTRING(ahv.Message,charindex('':'', ahv.Message)+2,LEN(ahv.Message)) as Message,ahv.EntityCaption as ''Alert Type'',DateAdd(HH,-4,asv.TriggeredDateTime) as EventTime,n.IPAddresses as IP_Address,srmsac.CRM_Account as CRM_Account from AlertActive as asv WITH(NOLOCK) inner join (select MAX(CAST(AlertRefID as varchar(255)))AlertRefID,MAX(ObjectType)ObjectType,MAX(AlertHistoryID)AlertHistoryID,MAX(RelatedNodeId)RelatedNodeId,MAX(ActionTypeID)ActionTypeID,MAX(EventTypeWord)EventTypeWord,MAX(Message)Message,MAX(EntityCaption)EntityCaption,AlertActiveID from AlertHistoryView where ActionTypeID = ''WriteToNPMEventLog'' and EventTypeWord = ''ActionSucceeded'' Group by AlertActiveID) as ahv on (asv.AlertActiveID = ahv.AlertActiveID) inner join ' + @srmtable + ' srmt on srmt.' + @newCol + ' = ''' + @objectId + ''' inner join SRM_StorageArrays n on n.StorageArrayID = srmt.StorageArrayID inner join SRM_StorageArrayCustomProperties srmsac on srmsac.StorageArrayID = n.StorageArrayID WHERE asv.AlertActiveID = ''' + @curAlert + ''' and n.Status <> 9 and ahv.AlertHistoryID > (select LastPulledEventID from LastAutoCasePull where id = 1)';

              set @tblParam = N'@retvalOUT nvarchar(255) OUTPUT';

              insert into @all_active_alerts exec sp_executesql @tblQuery, @tblParam, @retvalOUT=@srmCol OUTPUT;

             

             

              drop table #tmp;

              end

             

              set @i = @i + 1

              end

             

              select * from @all_active_alerts

            end