标签:
IBM TivoliMonitoring产品简称ITM,当前版本为6.5,该产品作为IBM软件产品的基础架构设施软件面向IT基础设施,云计算环境,虚拟化环境等都提供了全面的监控方法和独特的监控技术,IBM提供了常规的各式监控代理程序来解决各种通用性监控脚本,默认提供了包括操作系统代理、数据库代理、ERP代理、应用服务器代理等通用代理,为了解决更多复杂的、深入的、自定义的监控需求,ITM也提供了Universal Agent的通用Agent功能,并且提供了Universal Agent Builder开发环境来完成复杂功能的开发与测试。UniversalAgent基于Eclipse环境构建、使用C/C++,JAVA作为编程语言,利用SNMP V3,WMI等多种协议方式来进行编程。
在我们的开发需求中,需要对Windows环境的终端服务进行定制化监控、监控该服务的运行状态、依赖性服务、运行日志情况、警告及错误日志信息等。我们利用Universal Agent通用代理解决方案使用脚本数据提供程序来监控终端服务。
l 本UA部署环境要求具备 ITM 6.1 TEMS and TEPS环境,其中TEMS和TEPS数据库环境仅限于DB2\SQLSERVER\ORACLE环境,对于6.5环境中的MySQL环境不支持。
l Universal Agent 6.1 软件,Universal Agent Builder 6.1环境。Eclipse 3.6。
以下操作系统的终端服务经过了本开发的测试验证:
Windows2003Enterprise Edition
Windows2008 Enterprise Edition
Windows2008 R2 SP1 Enterprise Edition
l 操作系统启用 cscript command 脚本命令解释器
MSTermServ.MDL | If desired, change the monitored system’s interval time in //Name line as the following.
Example: //Name TSLogOnUser K 1200 Interval=180 //Source Script cscript GetUserTXT.vbs //Source Script cscript GetTSuser.vbs |
按照ITM的部署手册部署如下顺序的终端服务解决方案 TerminalService Agent
l 安装部署ITM的TEMS
l 安装部署ITM的TEPS.
l 在每一个监控目标节点服务器上部署UA组件
l 在开发机上部署UA Builder以及JDK环境、Eclipse环境。
TEPS和TEMS的数据源请使用统一数据源,如Oracle,TEPS和TEMS可以部署在不同的服务器上,但是在开发环境中,可以部署在同一台服务器上。
1. 将UA解决方案传输FTP到TEMS服务器,如D:\UAS。
2. 讲开发定义库文件kum_TS.zip复制到 TEMS和 TEPS服务器上,并解压。如下图:
3. 运行UA开发支持工具包。Windows环境使用setupwin32.exe,AIX环境使用setupAIX.bin,
4. 确认安装路径
5. 定义安装TEMS和TEPS, Tivoli Enterprise monitoringServer和 TivoliEnterprise Portal Server信息被安装器部署为桌面系统
6. 定义IBM Tivoli Universal Agent for Terminal Service安装,配置好环境变量
7. 下一步,重启ITM服务,其中会按照顺序启动TEPS和 TEMS
8. 完成安装后,ITM将会出现TerminalService Agent workspaces.的选择项。
l 解压 kum_TS.zip到一个临时目录
l 拷贝 MSTermServ.MDL到 "<ITMHOME>\TMAITM6\metafiles"目录.
l 拷贝全部.vbs 文件到 "<ITMHOME>\TMAITM6\scripts"目录.
l 打开 DOS 窗口.
l 导航至 "<ITMHOME>\TMAITM6\"
l 从目录 "<ITMHOME>\TMAITM6\ 运行如下命令,以导入MDL头文件。:
"kumpconimport MSTermServ.MDL"
1. 在TEP登陆的配置文件中,修改如下参数
"CustomizedNodeName:MSTERMSERV00" under the Universal Agent node.
以下是定义数据结构的过程中对Windows Terminal Services Universal Agent.的终端服务的定义和Metrics接口定义。以下是整个定义表的内容。
Metrics | Attribute Group | 描述 |
TSSystemName | OSINFO | 运行终端服务的机器名 |
Caption | OSINFO | 捕获操作 |
CurrentTimeZone | OSINFO | 当前服务器的时区 |
RegisteredUser | OSINFO | 注册的系统用户 |
MaxProcessMemorySize | OSINFO | 最大处理内存尺寸 |
NumberOfProcesses | OSINFO | 最大处理器尺寸 |
Manufacturer | OSINFO | 定义的功能信息遍历 |
OSType | OSINFO | 操作系统类型 |
Version | OSINFO | 操作系统版本 |
ServicePack | OSINFO | 操作系统补丁级别 |
NumberOfUsers | OSINFO | 用户数量 |
TSPort | OSINFO | 终端服务的默认端口 |
ID | TSLogOnUser | 行ID |
UserName | TSLogOnUser | 登录到服务器的用户名 |
SessionName | TSLogOnUser | 登录到服务器的会话名 |
UserID | TSLogOnUser | 用户ID信息 |
Stat | TSLogOnUser | Display every session stat logging on the server by terminal service |
IdleETime | TSLogOnUser | Idle time of each session |
LogOnDate | TSLogOnUser | Log on date |
ID | TSProcess | Display row id number |
UserName | TSProcess | User name logging on the server by terminal service |
SessionName | TSProcess | Session name logging on the server by terminal service |
UserID | TSProcess | User id information |
PID | TSProcess | Process id information of logging on the sever. |
ProcessImage | TSProcess | Process image information of logging on the server. |
Name | TSsessionIO | Session name of sessions logged onto the server by terminal service. |
InputAsyncFrameError | TSsessionIO | Input asyncframe error information |
InputAsyncOverflow | TSsessionIO | Input async over flow information |
InputAsyncOverrun | TSsessionIO | Input async over run information |
InputAsyncParityError | TSsessionIO | Input async parity error information |
InputBytes | TSsessionIO | Input bytes |
InputCompressedBytes | TSsessionIO | Input compressed bytes for each running session |
InputCompressFlushes | TSsessionIO | Input compress flushes information |
InputCompressionRatio | TSsessionIO | Input compression ratio |
InputErrors | TSsessionIO | Input error information |
InputFrames | TSsessionIO | Input frames information. |
InputTimeouts | TSsessionIO | Input timeouts information |
InputTransportErrors | TSsessionIO | Input transport errors information |
InputWaitForOutBuf | TSsessionIO | Input wait for out buffer information |
InputWdBytes | TSsessionIO | wd bytes |
InputWdFrames | TSsessionIO | wd frames information |
HandleCount | TSsessionIO | handle count information |
OutputAsyncFrameError | TSsessionIO | Output async frame error info |
OutputAsyncOverflow | TSsessionIO | Output async over flow info |
OutputAsyncOverrun | TSsessionIO | Async over run info |
OutputAsyncParityError | TSsessionIO | Async parity error info |
OutputBytes | TSsessionIO | Output bytes info |
OutputCompressedBytes | TSsessionIO | Output compressed bytes info |
OutputCompressFlushes | TSsessionIO | Output compress flushes info |
OutputCompressionRatio | TSsessionIO | Output compression ratio info |
OutputErrors | TSsessionIO | Output error |
OutputFrames | TSsessionIO | Output frames info |
OutputTimeouts | TSsessionIO | Output timeouts info |
OutputTransportErrors | TSsessionIO | Output transport error info |
OutputWaitForOutBuf | TSsessionIO | Output wait for output buffer info |
OutputWdBytes | TSsessionIO | Output WD bytes info |
OutputWdFrames | TSsessionIO | Output WD frame info |
PageFaultsPersec | TSsessionIO | Page faults percent information. |
PageFileBytes | TSsessionIO | Page file bytes |
PageFileBytesPeak | TSsessionIO | Page file bytes peak |
PercentPrivilegedTime | TSsessionIO | Percent of privileged time |
PercentProcessorTime | TSsessionIO | Percent of processor time |
PercentUserTime | TSsessionIO | Percent of running user time |
PoolNonpagedBytes | TSsessionIO | Pool non paged bytes info |
PoolPagedBytes | TSsessionIO | Pool paged bytes |
PrivateBytes | TSsessionIO | Private bytes info |
Name | TSsessionRecord | Session name of logging on the server by terminal service. |
ProtocolBitmapCacheHitRatio | TSsessionRecord | Bitmap cache hit ratio of protocol |
ProtocolBitmapCacheHits | TSsessionRecord | Bitmap cache hit of protocol |
ProtocolBitmapCacheReads | TSsessionRecord | Bitmap cache hit reads of protocol |
ProtocolBrushCacheHitRatio | TSsessionRecord | Brush cache hit ratio of protocol |
ProtocolBrushCacheHits | TSsessionRecord | Brush cache hits of protocol |
ProtocolBrushCacheReads | TSsessionRecord | Brush cache reads of protocol |
ProtocolGlyphCacheHitRatio | TSsessionRecord | Glyph cache hits of protocol |
ProtocolGlyphCacheHits | TSsessionRecord | Glyph cache hits of protocol |
ProtocolGlyphCacheReads | TSsessionRecord | Glyph cache reads of protocol |
PlSaveScreenBitmapCacheHitRatio | TSsessionRecord | Save screen bitmap cache hit ratio of protocol |
PlSaveScreenBitmapCacheHits | TSsessionRecord | Save screen bitmap cache hits of protocol |
PlSaveScreenBitmapCacheReads | TSsessionRecord | Save screen bitmap cache reads of protocol |
ThreadCount | TSsessionRecord | Thread count |
TotalAsyncFrameError | TSsessionRecord | Total async frame errors |
TotalAsyncOverflow | TSsessionRecord | Async over run info |
TotalAsyncOverrun | TSsessionRecord | Async over run info |
TotalAsyncParityError | TSsessionRecord | Async parity error info |
TotalBytes | TSsessionRecord | Total bytes |
TotalCompressedBytes | TSsessionRecord | Total compressed bytes |
TotalCompressFlushes | TSsessionRecord | Total compress flushes info |
TotalCompressionRatio | TSsessionRecord | Total compress flushed ratio info |
TotalErrors | TSsessionRecord | Total errors |
TotalFrames | TSsessionRecord | Total frames |
TotalProtocolCacheHitRatio | TSsessionRecord | Total cache hit ratio info of protocol |
TotalProtocolCacheHits | TSsessionRecord | Total hits of protocol |
TotalProtocolCacheReads | TSsessionRecord | Total cache reads of protocol |
TotalTimeouts | TSsessionRecord | Total timeouts |
TotalTransportErrors | TSsessionRecord | Total transport errors |
TotalWaitForOutBuf | TSsessionRecord | Total waiting output buffer info |
TotalWdBytes | TSsessionRecord | Total wd bytes |
TotalWdFrames | TSsessionRecord | wd frames info |
VirtualBytes | TSsessionRecord | Virtual bytes info |
VirtualBytesPeak | TSsessionRecord | Virtual bytes peak |
WorkingSet | TSsessionRecord | Working set info |
WorkingSetPeak | TSsessionRecord | Working peak info |
productCode = kum_TerminalService
productDescription = IBM Tivoli Universal Agent forTerminal Service
productVersion = 01100000
platformVersion = 06100000
supportsTEPD = false
‘########################################################################
‘Get basic information from server.
‘########################################################################
On Error Resume Next
arrComputers = Array("localhost")
For Each strComputer In arrComputers
Set objWMIService =GetObject("winmgmts:\\" & strComputer)
Set colOperatingSystems =objWMIService.InstancesOf("Win32_OperatingSystem")
ForEach objOperatingSystem In colOperatingSystems
Wscript.Echo "" & objOperatingSystem.Caption & _
"|" & objOperatingSystem.CurrentTimeZone & _
"|" & objOperatingSystem.RegisteredUser & _
"|" & objOperatingSystem.MaxProcessMemorySize & _
"|" & objOperatingSystem.NumberOfProcesses & _
"|" & objOperatingSystem.Manufacturer & _
"|" & objOperatingSystem. OSType & _
"|" & objOperatingSystem.Version & _
"|" & objOperatingSystem.CSDVersion & _
"|" & objOperatingSystem.NumberOfUsers & _
"|3398"
Next
Next
‘########################################################################
‘Get process information by qprocess *command
‘########################################################################
strComputer = "."
Set objWMIService =GetObject("winmgmts:\\" & strComputer &"\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_OperatingSystem",,48)
For Each objItem in colItems
windowsdir=objItem.WindowsDirectory
Next
‘Create a txt file .
Set WshShell =Wscript.CreateObject("Wscript.Shell")
path = WScript.ScriptFullName ‘ Script file name
GetPath = Left(path, InstrRev(path,"\")) ‘path name
rundir="cmd.exe /c " &windowsdir & "\system32\qprocess *>" & GetPath &"qprocess.txt"
IsSuccess = WshShell.Run (rundir,1,true)‘run cmd
‘########################################################################
‘Analyse information from the fixed file.
‘########################################################################
Const ForReading = 1, ForWriting = 2,ForAppending = 8
Dim fso, f
path = WScript.ScriptFullName ‘ Script file name
GetPath = Left(path, InstrRev(path,"\")) ‘find the local path
Set fso =CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(GetPath &"qprocess.txt", ForReading)
conm=0
Do While Not f.AtEndOfStream
ReadTextFileTest = f.readline
MyString =Replace(ReadTextFileTest, " ", " ",2)
MyString1 = Replace(MyString, " ", " ")
MyString2 = Replace(MyString1, " ", " ")
MyString3 = Replace(MyString2, " ", " ")
MyString4 = Replace(MyString3, " ", " ")
MyString5 = Replace(MyString4, " ", " ")
MyString6 = Replace(MyString5, " ", "|")
Ifconm = 0 Then
Wscript.Echoconm & "|&|-|-|-|-"
End If
Ifconm > 0 Then
Wscript.Echo conm & "|" & MyString6
End If
conm=conm+1
loop
‘########################################################################
‘Get session io information from WMI
‘########################################################################
strComputer = "."
Set objWMIService =GetObject("winmgmts:\\" & strComputer &"\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_PerfRawData_TermService_TerminalServicesSession")
For Each objItem in colItems
Wscript.Echo "" & objItem.Name &_
"|" &objItem.InputAsyncFrameError & _
"|" &objItem.InputAsyncOverflow & _
"|" &objItem.InputAsyncOverrun & _
"|"& objItem.InputAsyncParityError &_
"|" &objItem.InputBytes & _
"|" &objItem.InputCompressedBytes & _
"|" &objItem.InputCompressFlushes & _
"|" &objItem.InputCompressionRatio & _
"|" &objItem.InputErrors & _
"|" &objItem.InputFrames & _
"|" &objItem.InputTimeouts & _
"|" &objItem.InputTransportErrors & _
"|" &objItem.InputWaitForOutBuf & _
"|" &objItem.InputWdBytes & _
"|" &objItem.InputWdFrames & _
"|" &objItem.HandleCount & _
"|" &objItem.OutputAsyncFrameError & _
"|" &objItem.OutputAsyncOverflow & _
"|" &objItem.OutputAsyncOverrun & _
"|" &objItem.OutputAsyncParityError & _
"|" &objItem.OutputBytes & _
"|" &objItem.OutputCompressedBytes & _
"|" &objItem.OutputCompressFlushes & _
"|" &objItem.OutputCompressionRatio &_
"|" &objItem.OutputErrors & _
"|" &objItem.OutputFrames & _
"|" &objItem.OutputTimeouts & _
"|" &objItem.OutputTransportErrors & _
"|" &objItem.OutputWaitForOutBuf & _
"|" &objItem.OutputWdBytes & _
"|" &objItem.OutputWdFrames & _
"|" &objItem.PageFaultsPersec & _
"|" &objItem.PageFileBytes & _
"|" &objItem.PageFileBytesPeak & _
"|" &objItem.PercentPrivilegedTime & _
"|" &objItem.PercentProcessorTime & _
"|" &objItem.PercentUserTime & _
"|" &objItem.PoolNonpagedBytes &_
"|" &objItem.PoolPagedBytes & _
"|" &objItem.PrivateBytes &vbCrLf
Next
‘########################################################################
‘Get session record information from WMI
‘########################################################################
strComputer = "."
Set objWMIService =GetObject("winmgmts:\\" & strComputer &"\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROMWin32_PerfRawData_TermService_TerminalServicesSession")
For Each objItem in colItems
Wscript.Echo"" & objItem.Name & _
"|" & objItem.ProtocolBitmapCacheHitRatio & _
"|" & objItem.ProtocolBitmapCacheHits & _
"|" & objItem.ProtocolBitmapCacheReads & _
"|" & objItem.ProtocolBrushCacheHitRatio & _
"|" & objItem.ProtocolBrushCacheHits & _
"|" & objItem.ProtocolBrushCacheReads & _
"|" & objItem.ProtocolGlyphCacheHitRatio & _
"|" & objItem.ProtocolGlyphCacheHits & _
"|" & objItem.ProtocolGlyphCacheReads & _
"|" & objItem.ProtocolSaveScreenBitmapCacheHitRatio & _
"|" & objItem.ProtocolSaveScreenBitmapCacheHits & _
"|" & objItem.ProtocolSaveScreenBitmapCacheReads & _
"|" & objItem.ThreadCount &_
"|" & objItem.TotalAsyncFrameError & _
"|" & objItem.TotalAsyncOverflow & _
"|" & objItem.TotalAsyncOverrun & _
"|" & objItem.TotalAsyncParityError & _
"|" & objItem.TotalBytes &_
"|" & objItem.TotalCompressedBytes & _
"|" & objItem.TotalCompressFlushes & _
"|" & objItem.TotalCompressionRatio & _
"|" & objItem.TotalErrors &_
"|" & objItem.TotalFrames &_
"|" & objItem.TotalProtocolCacheHitRatio & _
"|" & objItem.TotalProtocolCacheHits & _
"|" & objItem.TotalProtocolCacheReads & _
"|" & objItem.TotalTimeouts & _
"|" &objItem.TotalTransportErrors &_
"|" & objItem.TotalWaitForOutBuf & _
"|" & objItem.TotalWdBytes &_
"|" & objItem.TotalWdFrames & _
"|" & objItem.VirtualBytes &_
"|" & objItem.VirtualBytesPeak & _
"|" & objItem.WorkingSet &_
"|" & objItem.WorkingSetPeak & vbCrLf
Next
‘########################################################################
‘Analyse logging user information fromfixed file.
‘########################################################################
Const ForReading = 1, ForWriting = 2,ForAppending = 8
Dim fso, f
path = WScript.ScriptFullName ‘ Script file name
GetPath = Left(path, InstrRev(path,"\")) ‘find the local path
Set fso =CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(GetPath &"TSuser.txt", ForReading)
conm=0
Do While Not f.AtEndOfStream
ReadTextFileTest = f.readline
MyString = Replace(ReadTextFileTest, " ", " ",2)
MyString1 = Replace(MyString, " ", " ")
MyString2 = Replace(MyString1, " ", " ")
MyString3 = Replace(MyString2, " ", " ")
MyString4 = Replace(MyString3, " ", " ")
MyString5 = Replace(MyString4, " ", " ")
MyString6 = Replace(MyString5, " ", "|")
Ifconm = 0 Then
Wscript.Echo conm & "|&|-|-|-|-|-"
End If
Ifconm > 0 Then
Wscript.Echo conm & "|" & MyString6
End If
conm=conm+1
loop
MSTermServ.MDL
//APPL MSTermServ
//Name OSINFO K 1200 Interval=120
//Source Script cscript GetOperatingSys.vbs
//Attributes DLM=‘|‘
TSSystemName (GetEnvValue = HOSTNAME)
Caption D128 K @OS Caption
CurrentTimeZone D 128 @ CurrentTime Zone
RegisteredUser D 128 @Registered System User
MaxProcessMemorySize D128 @ Max Process Memory Size
NumberOfProcesses D 128 @Number Of Processes
Manufacturer D 64 @Manufacturer
OSType D32 @ OS Type
Version D32 @ OS Version
ServicePack D32 @ OS Service Pack Info
NumberOfUsers D 1000 @ Numberof System User
TSPort D12 @ Terminal Service DefaultPort
//Name TSLogOnUser K 1200 Interval=120
//Source Script cscript GetUserTXT.vbs
//Source Script cscript GetTSuser.vbs
//Attributes DLM=‘|‘
ID C999999 -FILTER={SCAN(0,Micr) OR SCAN(0,Copy)}
UserName D56 @ User Name
SessionName D 128 @ Session Name
UserID D20 @ User ID
Stat D30 @ User stat
IdleETime D100 @ Idle Time
LogOnDate D60 @ Log On Date
//Name TSProcess K 1200 Interval=120
//Source Script cscript GetProcessTXT.vbs
//Source Script cscript GetTSprocess.vbs
//Attributes DLM=‘|‘
ID C999999 -FILTER={SCAN(0,Micr) ORSCAN(0,Copy)}
UserName D56 @ User Name
SessionName D 128 @ Session Name
UserID D20 @ User ID
PID D15 @ Process ID
ProcessImage D 100 @ RunningProgram
//Name TSsessionIO K 1200 Interval=120
//Source Script cscript GetTSsessionIO.vbs
//Attributes DLM=‘|‘
Name D 356 -FILTER={SCAN(0,Micr)OR SCAN(0,Copy)}
InputAsyncFrameError C 2147483647
InputAsyncOverflow C 2147483647
InputAsyncOverrun C 2147483647
InputAsyncParityError C 2147483647
InputBytes C 2147483647
InputCompressedBytes C 2147483647
InputCompressFlushes C 2147483647
InputCompressionRatio C 2147483647
InputErrors C 2147483647
InputFrames C 2147483647
InputTimeouts C 2147483647
InputTransportErrors C 2147483647
InputWaitForOutBuf C 2147483647
InputWdBytes C 2147483647
InputWdFrames C 2147483647
HandleCount C 2147483647
OutputAsyncFrameError C 2147483647
OutputAsyncOverflow C 2147483647
OutputAsyncOverrun C 2147483647
OutputAsyncParityError C 2147483647
OutputBytes C 2147483647
OutputCompressedBytes C 2147483647
OutputCompressFlushes C 2147483647
OutputCompressionRatio C 2147483647
OutputErrors C 2147483647
OutputFrames C 2147483647
OutputTimeouts C 2147483647
OutputTransportErrors C 2147483647
OutputWaitForOutBuf C 2147483647
OutputWdBytes C 2147483647
OutputWdFrames C 2147483647
PageFaultsPersec C 2147483647
PageFileBytes C 2147483647
PageFileBytesPeak C 2147483647
PercentPrivilegedTime C 9999999999
PercentProcessorTime C 9999999999
PercentUserTime C 9999999999
PoolNonpagedBytes C 9999999999
PoolPagedBytes C 9999999999
PrivateBytes C 9999999999
//Name TSsessionRecord K 1200 Interval=120
//Source Script cscriptGetTSsessionRecord.vbs
//Attributes DLM=‘|‘
Name D 356 -FILTER={SCAN(0,Micr)OR SCAN(0,Copy)}
ProtocolBitmapCacheHitRatio C 9999999999
ProtocolBitmapCacheHits C 9999999999
ProtocolBitmapCacheReads C 9999999999
ProtocolBrushCacheHitRatio C 9999999999
ProtocolBrushCacheHits C 9999999999
ProtocolBrushCacheReads C 9999999999
ProtocolGlyphCacheHitRatio C 9999999999
ProtocolGlyphCacheHits C 9999999999
ProtocolGlyphCacheReads C 9999999999
PlSaveScreenBitmapCacheHitRatio C 9999999999
PlSaveScreenBitmapCacheHits C 9999999999
PlSaveScreenBitmapCacheReads C 9999999999
ThreadCount C 9999999999
TotalAsyncFrameError C 9999999999
TotalAsyncOverflow C 9999999999
TotalAsyncOverrun C 9999999999
TotalAsyncParityError C 9999999999
TotalBytes C 9999999999
TotalCompressedBytes C 9999999999
TotalCompressFlushes C 9999999999
TotalCompressionRatio C 9999999999
TotalErrors C 9999999999
TotalFrames C 9999999999
TotalProtocolCacheHitRatio C 9999999999
TotalProtocolCacheHits C 9999999999
TotalProtocolCacheReads C 9999999999
TotalTimeouts C 9999999999
TotalTransportErrors C 9999999999
TotalWaitForOutBuf C 9999999999
TotalWdBytes C 9999999999
TotalWdFrames C 9999999999
VirtualBytes C 9999999999
VirtualBytesPeak C 9999999999
WorkingSet C 9999999999
WorkingSetPeak C 9999999999
数据库操作的DML,SQL代码:
/* Templates */
/* Template status */
/* Template states */
/* Commands */
/* Situations */
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "HOTLIST_offline";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143916000",
"V100",
"SYSADMIN",
"",
"*IF *SCAN SNMP-MANAGERMANAGED-NODES00.Node_Status *EQ Off-line",
"E",
"0",
"000100",
"*NONE",
"HOTLIST_offline",
"Kum:KUM1000",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_egpError";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143916000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE MIB-2EGP00.egpInErrors *GE 10 *OR *VALUE MIB-2EGP00.egpOu
tErrors *GE 10",
"E",
"0",
"000100",
"*NONE",
"MB2_egpError",
"Kum:KUM1001",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_egpNeighError";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143916000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE MIB-2EGPNEIGHTABLE00.egpNeighInErrs *GE 10 *OR *VALUE MIB
-2EGPNEIGHTABLE00.egpNeighOutErrs *GE 10",
"E",
"0",
"000100",
"*NONE",
"MB2_egpNeighError",
"Kum:KUM1002",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_icmpError";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143916000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE MIB-2ICMP00.icmpOutErrors *GE20 *OR *VALUE MIB-2ICMP00.ic
mpInErrors *GE 20",
"E",
"0",
"000100",
"*NONE",
"MB2_icmpError",
"Kum:KUM1003",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_interfaceDown";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143916000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE MIB-2IFTABLE00.ifOperStatus *EQ 2",
"E",
"0",
"000100",
"*NONE",
"MB2_interfaceDown",
"Kum:KUM1004",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_interfaceInError";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143916000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE MIB-2IFTABLE00.ifInErrors *GE 20 *OR *VALUE MIB-2IFTABLE0
0.ifInDiscards *GE 100",
"E",
"0",
"000100",
"*NONE",
"MB2_interfaceInError",
"Kum:KUM1005",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_interfaceOutError";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143916000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE MIB-2IFTABLE00.ifOutErrors *GE 20 *OR *VALUE MIB-2IFTABLE
00.ifOutDiscards *GE 100",
"E",
"0",
"000100",
"*NONE",
"MB2_interfaceOutError",
"Kum:KUM1006",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_ipFragmentationError";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143916000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE MIB-2IP00.ipFragFails *GE 10",
"E",
"0",
"000100",
"*NONE",
"MB2_ipFragmentationError",
"Kum:KUM1007",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_ipInError";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143916000",
"V100",
"SYSADMIN",
"",
"*IF ( *VALUE MIB-2IP00.ipInHdrErrors *GE 5 *OR *VALUE MIB-2IP00.ipIn
UnknownProtos *GE 20 ) *OR *VALUE MIB-2IP00.ipInDiscards *GE 20",
"E",
"0",
"000100",
"*NONE",
"MB2_ipInError",
"Kum:KUM1008",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_ipOutError";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143916000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE MIB-2IP00.ipOutDiscards *GE 20 *OR *VALUE MIB-2IP00.ipOut
NoRoutes *GE 20",
"E",
"0",
"000100",
"*NONE",
"MB2_ipOutError",
"Kum:KUM1009",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_snmpOperationViolations"
;
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143917000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE MIB-2SNMP00.snmpInBadCommunityNames *GE 10 *OR *VALUE MIB
-2SNMP00.snmpInBadCommunityUses *GE 10",
"E",
"0",
"000100",
"*NONE",
"MB2_snmpOperationViolations",
"Kum:KUM1010",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_tcpError";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143917000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE MIB-2TCPCONNTABLE00.tcpInErrs *GE 10",
"E",
"0",
"000100",
"*NONE",
"MB2_tcpError",
"Kum:KUM1011",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_udpError";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143917000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE MIB-2UDP00.udpInErrors *GE 10",
"E",
"0",
"000100",
"*NONE",
"MB2_udpError",
"Kum:KUM1012",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "NETWORK_not_responding";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143917000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE SNMP-MANAGERNETSUMMARY00.Max_RespTime_ms *GT 500",
"E",
"0",
"000100",
"*NONE",
"NETWORK_not_responding",
"Kum:KUM1013",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "ROUTER_status_offline";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143917000",
"V100",
"SYSADMIN",
"",
"*IF *SCAN SNMP-MANAGERROUTER00.Router_Status *EQ Off-line",
"E",
"0",
"000100",
"*NONE",
"ROUTER_status_offline",
"Kum:KUM1014",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "TRAP_category_errors";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143917000",
"V100",
"SYSADMIN",
"",
"*IF *SCAN SNMP-MANAGERTRAP00.Category *EQ ‘Error Events‘",
"E",
"0",
"000000",
"*NONE",
"TRAP_category_errors",
"Kum:KUM1015",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "TRAP_severity_errors";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("00000000000000800000000000000000##000000000",
"*NO",
"*YES",
"",
"",
"1060523143917000",
"V100",
"SYSADMIN",
"",
"*IF *SCAN SNMP-MANAGERTRAP00.Severity *EQ Critical *OR *SCAN SNMP-MA
NAGERTRAP00.Severity *EQ ‘Major Error‘",
"E",
"0",
"000000",
"*NONE",
"TRAP_severity_errors",
"Kum:KUM1016",
"NNN",
"~",
"*NONE",
"*NONE"
);
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "TS_LOGON_USERl_BE_LIMITEDl";
INSERT INTO O4SRV.TSITDESC
(AFFINITIES,
ALERTLIST,
AUTOSTART,
HUB,
LSTCCSID,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJECTLOCK,
PDT,
QIBSCOPE,
REEV_DAYS,
REEV_TIME,
SENDMSGQ,
SITNAME,
TEXT,
AUTOSOPT,
SITINFO,
ADVISE,
CMD )
VALUES
("0000000000000080000000000000000000########F",
"",
"*YES",
"",
"zh_CN",
"1060528115000000",
"V100",
"SYSADMIN",
"",
"*IF *VALUE MSTERMSERVTSLOGONUSER00.ID *GT 3",
"E",
"0",
"001500",
"*NONE",
"TS_LOGON_USERl_BE_LIMITEDl",
"",
"NNY",
"~",
"*NONE",
"*NONE"
);
/* Object activation list */
DELETE FROM O4SRV.TOBJACCL WHERE OBJNAME = "TS_LOGON_USERl_BE_LIMITEDl";
INSERT INTO O4SRV.TOBJACCL
(NODEL,
OBJNAME,
HUB,
LSTDATE,
LSTRELEASE,
LSTUSRPRF,
OBJCLASS )
VALUES
("*CUSTOM_MSTERMSERV00",
"TS_LOGON_USERl_BE_LIMITEDl",
"Y",
"1060528115000000",
"",
"",
"5140"
);
/* Policies */
/* Policy activities */
/* Templates */
/* Template status */
/* Template states */
/* Situations */
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "HOTLIST_offline";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_egpError";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_egpNeighError";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_icmpError";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_interfaceDown";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_interfaceInError";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_interfaceOutError";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_ipFragmentationError";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_ipInError";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_ipOutError";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_snmpOperationViolations"
;
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_tcpError";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "MB2_udpError";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "NETWORK_not_responding";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "ROUTER_status_offline";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "TRAP_category_errors";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "TRAP_severity_errors";
DELETE FROM O4SRV.TSITDESC WHERE SITNAME = "TS_LOGON_USERl_BE_LIMITEDl";
/* Object activation list */
DELETE FROM O4SRV.TOBJACCL WHERE OBJNAME = "TS_LOGON_USERl_BE_LIMITEDl";
/* Policies */
/* Policy activities */
使用IBM Tivoli Monitoring Universal Agent自定义开发Windows Terminal Service监控服务
标签:
原文地址:http://blog.csdn.net/jaminwm/article/details/44960117