This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Powershell: how to override template parameters of an existing "user experience monitor"?

i created with powershell an application monitor from a template but i need to change/override parameters in an "Oracle User Experience Monitor", specifically i need to override "Destination Point Name:"

I have looked in the definition of "Orion.APM.Component", but i don't see there Verbs that permits to change the user experience monitor.

Any help appreciated...

  • i found this SQL-Statement that do this job:

    begin tran
    if @ComponentId <= 0
    begin
    insert into APM_Component (Name, ShortName, ComponentType, ApplicationID, TemplateID, ComponentOrder, IsDisabled)
    select @Name, @ShortName, @ComponentType, @ApplicationId, @CompTemplateId, @ComponentOrder, @IsDisabled
    select @ComponentId = SCOPE_IDENTITY()
    end
    else
    begin
    update APM_Component
    set
    Name = @Name,
    ShortName = @ShortName,
    ComponentType = @ComponentType,
    ApplicationID = @ApplicationId,
    TemplateID = @CompTemplateId,
    ComponentOrder = @ComponentOrder,
    IsDisabled = @IsDisabled
    where ID = @ComponentId
    end
    select @ComponentId
    DECLARE @externalSettingIds table
    (
    ID int NOT NULL,
    ExternalSettingID int NOT NULL
    )
    DELETE FROM APM_ExternalSetting
    WHERE ID IN
    (
    SELECT Value
    FROM APM_ComponentSetting
    WHERE ComponentID = @ComponentId
    AND ValueType = @ExternalValueType
    )
    DELETE FROM APM_ComponentSetting WHERE ComponentID = @ComponentId
    MERGE INTO APM_ExternalSetting AS target
    USING (SELECT ID,
    [Key],
    Value,
    ValueType,
    Required
    FROM @componentSettings
    WHERE ValueType = @ExternalValueType) AS source
    ON 1 = 0
    WHEN NOT MATCHED BY TARGET THEN
    INSERT (Setting) VALUES ( source.value)
    OUTPUT source.ID, INSERTED.ID AS ExternalSettingID INTO @externalSettingIds;
    INSERT INTO APM_ComponentSetting (ComponentID, [Key], Value, ValueType, Required)
    SELECT @ComponentId,
    setting.[Key],
    CASE WHEN extSetting.ExternalSettingID IS NULL
    THEN setting.Value
    ELSE CAST(extSetting.ExternalSettingID AS nvarchar(max))
    END,
    setting.ValueType,
    setting.Required
    FROM @componentSettings setting
    LEFT JOIN @externalSettingIds extSetting
    ON setting.ID = extSetting.ID commit tran ',N'@IsDisabled bit,@Name nvarchar(125),@ShortName nvarchar(125),@ComponentType int,@ApplicationId int,@CompTemplateId bigint,@ComponentOrder int,@componentSettings [APM_ComponentSettingTableType] READONLY,@ComponentId bigint,@ExternalValueType int'

    But, it doesn't exist a supported way to script my requirement in powershell?