`
taupo
  • 浏览: 28468 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

CLIP 笔记

阅读更多

1、安装SCATUO

2、修改SCAUTO配置文件

3、修改SM配置文件

4、IM.close.incident

5、IM.update.incident

6、修改addanno.vbs如下

'on error resume next

Dim WshShell, bKey, objController, objRemoteScript

Set WshShell = WScript.CreateObject("WScript.Shell")
Set colNamedArguments = WScript.Arguments.Named

If WScript.Arguments.Count = 1 Then
 Msgid = colNamedArguments.Item("Id")
 'AnnotationNbr = colNamedArguments.Item("Nbr")

Else
 Wscript.Echo "Usage: addanno.vbs /Id:<msg id>"
 Wscript.Quit
End If

if Msgid = "" Then
 Wscript.Echo "Usage: addanno.vbs /Id:<msg id>"
 Wscript.Quit
Else
  wscript.echo "Msgid: " & Msgid
End if

SourceName = "localhost"

Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set WMISrc = objLocator.ConnectServer(SourceName, "root\HewlettPackard\OpenView\data", "", "")
WMISrc.Security_.impersonationlevel = 3

 

Function GetCma( WMIPtr, MsgId, CmaName )

  Set MessageSet = WMIPtr.ExecQuery("Select * from OV_Message where Id='" & MsgId & "'")
  Value = ""

  For Each OV_Message In MessageSet
      Cmas = OV_Message.CMAs
      If IsNull(Cmas) Then
        Value = ""
      Else
        For each Cma in Cmas
          if Cma.name = CmaName then
            Value = Cma.value
          end if
        Next
      End if
  Next

  GetCma = Value

End Function

 

Function GetAnnotation ( WMIPtr, MsgId)
  Dim Annotations()

  ActualText =0
  Set MessageSet = WMIPtr.ExecQuery("Select * from OV_Message where Id='" & MsgId & "'")
 
  For Each OV_Message In MessageSet
 AnnoCount=OV_Message.NumberOfAnnotations
   if OV_Message.NumberOfAnnotations=0 then
    AnnoCount=1
   End If
      for j=1 to AnnoCount
   Error = OV_Message.GetAnnotationArray( j, 1, 0, Annotations )
        I = 1
        For each Anno in Annotations
   if instr(Anno.Text,"http://f5tpc.poc.com:8888")<>0 then
    ActualText=1
   End If
        Next
      next
     
  Next

  GetAnnotation = ActualText

End Function

 

 

 

 

 

Function GetText( WMIPtr, MsgId)

  Set MessageSet = WMIPtr.ExecQuery("Select * from OV_Message where Id='" & MsgId & "'")
  Value = ""

  For Each OV_Message In MessageSet
    Value = OV_Message.Text
  Next

  GetText = Value

End Function

Function NbrOfCmas ( WMIPtr, MsgId )
  I = 0

  Set MessageSet = WMIPtr.ExecQuery("Select * from OV_Message where Id='" & MsgId & "'")

  For Each OV_Message In MessageSet
      Cmas = OV_Message.CMAs

      If IsNull(Cmas) Then
        I = 0
      Else
        For each Cma in Cmas
          I = I + 1
        Next
      End If
  Next

  RemNbrOfCmas = I

End Function

Sub AddAnnotation( WMIPtr, MsgId, Text )

  Set MessageSet = WMIPtr.ExecQuery("Select * from OV_Message where Id='" & MsgId & "'")

  For Each OV_Message In MessageSet
    Error = OV_Message.AddAnnotation(Text)
  Next

End Sub

TestCma = GetCma( WMISrc, Msgid, "CauseEventId" )

if TestCma = "" Then
  wscript.echo "Cma CAUSE not found"
Wscript.Quit
Else
  wscript.echo "CMA CAUSE: " & TestCma

  MsgText = GetText( WMISRc, TestCma )
  if MsgText = "" Then
    wscript.echo "Msg not found" 
  Else
    wscript.echo "Text: " & MsgText

   if GetAnnotation(WMISrc, MsgId)=0 then
   AddAnnotation WMISrc, MsgId, "Correlated cause event is: " & MsgText & ". See

http://f5tpc.poc.com:8888/opr-console/eventDetails.jsf?id=" & MsgId & " for details on related events."
   End If
  End If
End if

 

 

7、在Tailoring-->Event Service中查看PMU,PMC情况(只能用search,不能用find)

8、如果无法更新工单,但是event in里面有相关pmu,只是pmu记录无incident id,那么检查时区是否为北京

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics