IBM TBSM 業務關聯規則配置一例

來源:互聯網
上載者:User

最近在公司的項目中使用IBM TBSM進行業務關聯配置工作,整個模型描述大概如下:

從模型設計角度來看該業務系統如下:

服務狀態    B

業務節點    C1 ,D2 ,E3

業務資源    C11,C12,C13, D21,D22,D31,E32 

其中業務節點B1,B2,B3還要設定weight重要度

商務規則:

當業務資源發生黃色事件時,影響業務節點為黃色,業務總體狀態為黃色

當業務資源發生紅色事件是,如果業務節點weight=1,影響業務節點為紅色,業務總體狀態為紅色,當weight=0時,影響業務節點為紅色,業務總體狀態為黃色。

在TBSM模板配置中,

首先建立數字聚集規則擷取業務資源的最嚴重狀態,得到C,D,E的節點狀態

由於要參考weight的值,所以建立數字公示規則,計算業務狀態B的值。

公示指令碼如下:

log("Name value: " + ServiceInstance.DisplayName); log(0, "Child value: " + ServiceInstance.NUMCHILDREN); log(0, "Weight value: " + ServiceInstance.Weight); log(0, "STATUS value: " + int(ServiceInstance.RADSTATUS)); log(0, "STATUS1 value: " + InstanceNode.URM_APP_STATUS1.Value);

if ( int(InstanceNode.URM_STATUS.value) <> 2 and int(ServiceStatus) >= 3 and int(ServiceInstance.Weight) = 0) {   log(0, "filter a:");   Values = 3; } elseif ( int(InstanceNode.URM_STATUS.value) <> 2 and int(ServiceStatus) >= 3 and int(ServiceStatus) < 5 and int(ServiceInstance.Weight) = 1) { log(0, "filter b:");

  Values = 3; } elseif ( int(InstanceNode.URM_STATUS.value) <> 2 and int(ServiceStatus) = 5 and int(ServiceInstance.Weight) = 1 ) {   Values = 5; } else {   Values = 0; } log(0, "Values: " + Values);

Status = Values;

按照IBM 業務的定義,當資源發生狀態改變時,先調用數字聚集規則,產生狀態變化,在調用數字公式規則計算業務狀態,但是在實際使用中探索服務狀態總是無法恢複。嘗試分析了一下感覺TBSM在系統流程中當數字聚集規則返回狀態發生變化時,修改服務狀態同時調用了數字公式規則,但此時可能未對ServiceStatus進行加鎖操作,導致對ServiceStatus產生了一些並行操作,導致狀態計算問題(這個地方可能一般實施人員看不懂,和IBM溝通了幾次也沒說清楚這個問題,他們一直說他們的產品沒問題,按照他們的要求也改過幾次指令碼,無法解決這個問題,後來想了一個土辦法,在指令碼中判斷一下所有資源的狀態,來解決服務恢複問題,參考如下指令碼)

log("Name value: " + ServiceInstance.DisplayName); log(0, "Child value: " + ServiceInstance.NUMCHILDREN);

  log(0, "Weight value: " + ServiceInstance.Weight); log(0, "STATUS value: " + int(ServiceInstance.RADSTATUS)); log(0, "STATUS1 value: " + InstanceNode.URM_APP_STATUS1.Value);

ServiceStatus = InstanceNode.URM_APP_STATUS1.Value; if( ServiceStatus < InstanceNode.URM_APP_STATUS2.Value) {     ServiceStatus = InstanceNode.URM_APP_STATUS2.Value;     } SevStatus = ServiceInstance.RADSTATUS;

if( SevStatus > ServiceStatus ) {   ServiceStatus = SevStatus ; } index1=0; index = 0; count = 0; red = 0; yellow = 0; green = 0; nodesum =1; nodesum = ServiceInstance.NUMCHILDREN;

while( index1 < ServiceInstance.NUMCHILDREN) {   log("ChildName value: " + ServiceInstance.CHILDINSTANCEBEANS[index1].DisplayName);   log("ChildRad value: " + ServiceInstance.CHILDINSTANCEBEANS[index1].RADSTATUS);

    if( ServiceInstance.CHILDINSTANCEBEANS[index1].RADSTATUS = 0)     {    green = green + 1; }     if( ServiceInstance.CHILDINSTANCEBEANS[index1].RADSTATUS = 3)      {   yellow = yellow + 1; }     if( ServiceInstance.CHILDINSTANCEBEANS[index1].RADSTATUS = 5)      {   red = red + 1; }

    index1 = index1 +1; }   log(0, "green: " + green); if( green=nodesum) {

   ServiceStatus = 0; } log(0, "yellow: " + yellow); if( yellow > 0 ) {       ServiceStatus = 3;   } if( nodesum >0) {     reddiv = red/nodesum;     log(0, "red: " + red);     log(0, "nodesum: " + nodesum);     if( reddiv  >= 0.51)     {         log(0, "red/nodesum: " + reddiv);         ServiceStatus = 5;     }else{          if( reddiv > 0 )          {               ServiceStatus = 3;          }

    } } if ( int(InstanceNode.URM_STATUS.value) <> 2 and int(ServiceStatus) >= 3 and int(ServiceInstance.Weight) = 0) {   log(0, "filter a:");   Values = 3; } elseif ( int(InstanceNode.URM_STATUS.value) <> 2 and int(ServiceStatus) >= 3 and int(ServiceStatus) < 5 and int(ServiceInstance.Weight) = 1) { log(0, "filter b:");

  Values = 3; } elseif ( int(InstanceNode.URM_STATUS.value) <> 2 and int(ServiceStatus) = 5 and int(ServiceInstance.Weight) = 1 ) {   Values = 5; } else {   Values = 0; } log(0, "Values: " + Values);

Status = Values;

 

(有問題可以聯絡我一起探討)

 

 

 

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.