User bio
404 bio not found
Member since Mar 3, 2021
Replies:

This is a known issue Ensemble 2017.1 and fixed in 2017.2 or further version.I am getting a patch to for my instance.

Hi Kevin,
I tried the same steps, but not working, same issue as before . 
My version : Ensemble 2017.1
$ZV : Cache for UNIX (Red Hat Enterprise Linux for x86-64) 2017.1.3 (Build 317_0_18252U) .

Thanks for the response Kevin. Using this, I have modified my code to disable all the "Alerting" settings ( even though, they might not be present in the Ens_Config.Item table, but present in the Host class settings in mgmt portal(green color))

OID is , OID of the Ens_Config.Item table.
Here is my code.
Let me know, if I have to change anything.

UpdateSetting(Oid) public
{
Set sts = 0
Set tStatus = 0
If ($Get(Oid) '="")
{
Set item=##class(Ens.Config.Item).%OpenId(Oid) If $IsObject(item)
{
Set tSC = item.GetStaticSettings(.pList)
If $$$ISOK(tSC)
{
         Do item.PopulateVirtualSettings()
           Set n0 = $O(pList(""),-1)
           Set = item.VirtualSettings.Count()
           For = 1:1:
           {
            Set pList(n0+i) = item.VirtualSettings.GetAt(i)             //Check the group of this setting and we need only the Alerting group settings
            If ($LIST(pList(n0+i),16)="Alerting")
            {
             Set SettingName = $LIST(pList(n0+i),2)
             Set SettingType = $LIST(pList(n0+i),1)
             Set SettingDataType = $LIST(pList(n0+i),8)
            Set tSetting = item.FindSettingByName(SettingName, SettingType)
            //Write SettingName,!
            //ZW pList(n0+i)
            
            //If the Setting DataType is String set as empty, otherwise zero
            Set SettingValue = $Select(SettingDataType="%Library.String":"",1:0)
            
            //If the setting is present in Ens_Config.Item table/Production Host class, set the value alone, otherwise Populate the setting into it.
            If '$IsObject(tSetting) {
Set tSetting = ##class(Ens.Config.Setting).%New()
Set tSetting.Name = SettingName
Set tSetting.Target = SettingType
Set tStatus = tSetting.ValueSet(SettingValue)
If $$$ISERR(tStatus) Quit
Set tStatus = item.Settings.Insert(tSetting)
}
Else {
Set tStatus = tSetting.ValueSet(SettingValue)
}
Set sts = item.%Save()
            
       }        
           }     
     }
}
}
Quit (sts&&tStatus)
}

Followers:
Following:
Global Masters badges:
Purushothaman has no Global Masters badges yet.