달력

5

« 2024/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
Powershell

Agent의 Failover 설정 Cmdlet
$primaryMS = Get-ManagementServer | where {$_Name -eq 'Filtering'}
$failoverMS = Get-ManagementServer | where {$_Name -eq 'Filtering'}
$agent = Get-Agent | where {$_Name -eq 'Filtering'}
Set-ManagementServer -AgentManagedComputer: $Agent -ManagementServer: $PrimaryMS -FailoverServer: $FailoverMS

Gateway 서버의 Failover 설정 Cmdlet
$PrimaryMS = Get-ManagementServer | Where {$_Name -eq 'Filtering'}
$failoverMS = Get-ManagementServer | Where {$_Name -eq 'Filtering'}
$gatewayMS = Get-ManagementServer | Where {$_Name -eq 'Filtering'}
Set-ManagementServer -GatewayManagementServer: $gatewayMS -ManagementServer: $PrimaryMS -FailoverServer: $failoverMS
:
Posted by 커널64

– Find all managed servers that are down and not pingable
SELECT bme.DisplayName, s.LastModified
FROM state AS s, BaseManagedEntity AS
bme
WHERE s.basemanagedentityid = bme.basemanagedentityid AND
s.monitorid
IN (SELECT MonitorId FROM Monitor WHERE MonitorName = ‘Microsoft.SystemCenter.HealthService.ComputerDown’)

AND s.Healthstate = ‘3′
ORDER BY s.Lastmodified DESC

– Operational Database Version
SELECT DBVersion FROM __MOMManagementGroupInfo__

– Find a computer name from it’s Health Service ID (guid from agent proxy alerts)
SELECT id, path, fullname, displayname FROM ManagedEntityGenericView WHERE ID = ‘<GUID>’


– ALERTS SECTION –
——————–

– Most common alerts, by alert count
SELECT AlertStringName, AlertStringDescription, AlertParams, Name, SUM(1) AS AlertCount, SUM(RepeatCount+1) AS AlertCountWithRepeatCount
FROM Alertview WITH (NOLOCK)

WHERE ResolutionState = (0|255)
GROUP BY AlertStringName, AlertStringDescription, AlertParams, Name
ORDER BY AlertCount DESC

– TOP 10 common alerts
SELECT Top(10) AlertStringName, AlertStringDescription, AlertParams, Name, SUM(1) AS AlertCount, SUM(RepeatCount+1) AS AlertCountWithRepeatCount
FROM Alertview WITH (NOLOCK)

WHERE ResolutionState = (0|255)
GROUP BY AlertStringName, AlertStringDescription, AlertParams, Name
ORDER BY AlertCount DESC

– Most common alerts, by repeat count
SELECT AlertStringName, AlertStringDescription, AlertParams, Name, SUM(1) AS AlertCount, SUM(RepeatCount+1) AS AlertCountWithRepeatCount
FROM Alertview WITH (NOLOCK)

WHERE ResolutionState = (0|255)
GROUP BY AlertStringName, AlertStringDescription, AlertParams, Name
ORDER BY AlertCountWithRepeatCount DESC

– Number of alerts per day
SELECT CONVERT(VARCHAR(20), TimeAdded, 101) AS DayAdded, COUNT(*) AS NumAlertsPerDay
FROM Alert WITH (NOLOCK)

GROUP BY CONVERT(VARCHAR(20), TimeAdded, 101)
ORDER BY DayAdded DESC

– Number of alerts per day by resolution state
SELECT
CASE WHEN
(GROUPING(CONVERT(VARCHAR(20), TimeAdded, 101)) = 1) THEN ‘All Days’ ELSE CONVERT(VARCHAR(20), TimeAdded, 101) END AS [Date],
CASE WHEN
(GROUPING(ResolutionState) = 1) THEN ‘All Resolution States’ ELSE CAST(ResolutionState AS VARCHAR(5)) END AS [ResolutionState]
,
COUNT
(*) AS
NumAlerts
FROM Alert WITH (NOLOCK)

GROUP BY CONVERT(VARCHAR(20), TimeAdded, 101), ResolutionState WITH ROLLUP
ORDER BY DATE DESC


– EVENTS SECTION –
——————–

– Most common events by day by count
SELECT CASE WHEN(GROUPING(CONVERT(VARCHAR(20), TimeAdded, 101)) = 1)
THEN
‘All Days’
ELSE CONVERT
(VARCHAR(20), TimeAdded, 101) END AS DayAdded,
COUNT
(*) AS
NumEventsPerDay
FROM
EventAllView
GROUP BY CONVERT(VARCHAR(20), TimeAdded, 101) WITH
ROLLUP
ORDER BY DayAdded DESC

– Most common events by event number
SELECT Number, COUNT(*) AS "Number of Events"
FROM EventView
GROUP BY
Number
ORDER BY "Number of Events" DESC


– PERFORMANCE SECTION –
————————-

– Performance Insertions per day
SELECT CASE WHEN(GROUPING(CONVERT(VARCHAR(20), TimeSampled, 101)) = 1)
THEN
‘All Days’ ELSE CONVERT(VARCHAR(20), TimeSampled, 101)
END
AS DaySampled, COUNT(*) AS NumPerfPerDay
FROM
PerformanceDataAllView
GROUP BY CONVERT(VARCHAR(20), TimeSampled, 101) WITH
ROLLUP
ORDER BY DaySampled DESC

– Most common performance insertions by perf object and counter name:
SELECT pcv.objectname, pcv.countername, count (pcv.countername) AS total FROM performancedataallview AS pdv, performancecounterview AS pcv
WHERE (pdv.performancesourceinternalid = pcv.performancesourceinternalid)

GROUP BY pcv.objectname, pcv.countername
ORDER BY count (pcv.countername) DESC

– Most common performance insertions by perf object name:
SELECT pcv.objectname, count (pcv.countername) AS total FROM performancedataallview AS pdv, performancecounterview AS pcv
WHERE (pdv.performancesourceinternalid = pcv.performancesourceinternalid)

GROUP BY pcv.objectname
ORDER BY count (pcv.countername) DESC

– Most common performance insertions by perf counter name:
SELECT pcv.countername, count (pcv.countername) AS total FROM performancedataallview AS pdv, performancecounterview AS pcv
WHERE (pdv.performancesourceinternalid = pcv.performancesourceinternalid)

GROUP BY pcv.countername
ORDER BY count (pcv.countername) DESC


– STATE SECTION –
——————-

– State changes per day:
SELECT CASE WHEN(GROUPING(CONVERT(VARCHAR(20), TimeGenerated, 101)) = 1)
THEN
‘All Days’ ELSE CONVERT(VARCHAR(20), TimeGenerated, 101)
END
AS DayGenerated, COUNT(*) AS NumEventsPerDay
FROM StateChangeEvent WITH (NOLOCK)

GROUP BY CONVERT(VARCHAR(20), TimeGenerated, 101) WITH ROLLUP
ORDER BY DayGenerated DESC


– MANAGEMENT PACK INFO –
————————–

– To find all installed Management Packs and their version:
SELECT MPName, MPFriendlyName, MPVersion, MPIsSealed
FROM ManagementPack WITH(NOLOCK)

ORDER BY MPName

– Rules per MP:
SELECT mp.MPName, COUNT(*) AS RulesPerMP
FROM
Rules r
INNER JOIN ManagementPack mp ON
mp.ManagementPackID = r.ManagementPackID
GROUP BY
mp.MPName
ORDER BY RulesPerMP DESC

– Rules per MP by category:
SELECT mp.MPName, r.RuleCategory, COUNT(*) AS RulesPerMPPerCategory
FROM
Rules r
INNER JOIN ManagementPack mp ON
mp.ManagementPackID = r.ManagementPackID
GROUP BY
mp.MPName, r.RuleCategory
ORDER BY RulesPerMPPerCategory DESC

– Monitors Per MP:
SELECT mp.MPName, COUNT(*) AS MonitorsPerMPPerCategory
FROM
Monitor m
INNER JOIN ManagementPack mp ON
mp.ManagementPackID = m.ManagementPackID
GROUP BY
mp.MPName
ORDER BY COUNT(*) DESC

– To find your Monitor by common name:
SELECT * FROM Monitor
INNER JOIN LocalizedText LT ON
LT.ElementName = Monitor.MonitorName
WHERE LTValue = ‘My Monitor Name’

– To find all Rules per MP that generate an alert:
declare @mpid
AS varchar(50)
SELECT @mpid= managementpackid FROM managementpack WHERE
mpName=
‘Microsoft.BizTalk.Server.2006.Monitoring’
SELECT rl.rulename,rl.ruleid,md.modulename FROM rules rl, module md
WHERE
md.managementpackid = @mpid
AND
rl.ruleid=md.parentid
AND moduleconfiguration LIKE ‘%<AlertLevel>50</AlertLevel>%’

– To find all rules per MP with a given alert severity:
declare @mpid
AS varchar(50)
SELECT @mpid= managementpackid FROM managementpack WHERE
mpName=
‘Microsoft.BizTalk.Server.2006.Monitoring’
SELECT rl.rulename,rl.ruleid,md.modulename FROM rules rl, module md
WHERE
md.managementpackid = @mpid
AND
rl.ruleid=md.parentid
AND moduleconfiguration LIKE ‘%<Severity>2</Severity>%’

– Number of instances of a type:  (Number of disks, computers, databases, etc that OpsMgr has discovered)
SELECT mt.ManagedTypeID, mt.TypeName, COUNT(*) AS NumEntitiesByType
FROM BaseManagedEntity bme WITH(NOLOCK)

LEFT JOIN ManagedType mt WITH(NOLOCK) ON mt.ManagedTypeID = bme.BaseManagedTypeID
WHERE bme.IsDeleted = 0

GROUP BY mt.ManagedTypeID, mt.TypeName
ORDER BY COUNT(*) DESC

– Number of Views per Management Pack:
SELECT mp.MPName, v.ViewVisible, COUNT(*) AS ViewsPerMP
FROM [Views]
v
INNER JOIN ManagementPack mp ON
mp.ManagementPackID = v.ManagementPackID
GROUP BY
 mp.MPName, v.ViewVisible
ORDER BY v.ViewVisible DESC, COUNT(*) DESC

– Grooming:
SELECT * FROM PartitionAndGroomingSettings WITH (NOLOCK)

– All managed computers count:
SELECT COUNT(*) AS NumManagedComps FROM (
SELECT bme2.BaseManagedEntityID
FROM BaseManagedEntity bme WITH (NOLOCK)

INNER JOIN BaseManagedEntity bme2 WITH (NOLOCK) ON bme2.BaseManagedEntityID = bme.TopLevelHostEntityID
WHERE bme2.IsDeleted = 0

AND bme2.IsDeleted = 0
AND bme2.BaseManagedTypeID = (SELECT TOP 1 ManagedTypeID FROM ManagedType WHERE TypeName = ‘microsoft.windows.computer’)
GROUP BY bme2.BaseManagedEntityID
) AS Comps

– Classes available in the DB:
SELECT * FROM ManagedType

– Classes available in the DB for Microsoft Windows type:
SELECT * FROM ManagedType
WHERE TypeName LIKE ‘Microsoft.Windows.%’

– Every property of every class:
SELECT * FROM MT_Computer

– All instances of all types once discovered
SELECT * FROM BaseManagedEntity

– To get the state of every instance of a particular monitor the following query can be run, (replace <MonitorName> with the name of the monitor):
SELECT bme.FullName, bme.DisplayName, s.HealthState FROM state AS s, BaseManagedEntity AS bme
WHERE
s.basemanagedentityid = bme.basemanagedentityid
AND s.monitorid IN (SELECT MonitorId FROM Monitor WHERE MonitorName = ‘<MonitorName>’)

– For example, this gets the state of the Microsoft.SQLServer.2005.DBEngine.ServiceMonitor for each instance of the SQL 2005 Database Engine class.
SELECT bme.FullName, bme.DisplayName, s.HealthState
FROM state AS s, BaseManagedEntity AS
bme
WHERE
s.basemanagedentityid = bme.basemanagedentityid
AND s.monitorid IN (SELECT MonitorId FROM Monitor WHERE MonitorName = ‘Microsoft.SQLServer.2005.DBEngine.ServiceMonitor’)

– To find the overall state of any object in OpsMgr the following query should be used to return the state of the System.EntityState monitor:
SELECT bme.FullName, bme.DisplayName, s.HealthState
FROM state AS s, mt_managedcomputer AS mt, BaseManagedEntity AS
bme
WHERE
s.basemanagedentityid = bme.basemanagedentityid
AND s.monitorid IN (SELECT MonitorId FROM Monitor WHERE MonitorName = ‘System.Health.EntityState’)

– Rules are stored in a table named Rules. This table has columns linking rules to classes and Management Packs.
– To find all rules in a Management Pack use the following query and substitute in the required Management Pack name:
SELECT * FROM Rules WHERE ManagementPackID = (SELECT ManagementPackID FROM ManagementPack WHERE MPName = ‘Microsoft.Windows.Server.2003′)

– To find all rules targeted at a given class use the following query and substitute in the required class name:
SELECT * FROM Rules WHERE TargetManagedEntityType = (SELECT ManagedTypeId FROM ManagedType WHERE TypeName = ‘Microsoft.Windows.Computer’)

– The Alert table contains all alerts currently open in OpsMgr. This includes resolved alerts until they are groomed out of the database. To get all alerts across all instances of a given monitor use the following query and substitute in the required monitor name:

SELECT * FROM Alert WHERE ProblemID IN (SELECT MonitorId FROM Monitor WHERE MonitorName = ‘Microsoft.SQLServer.2005.DBEngine.ServiceMonitor’)

– To retrieve all alerts for all instances of a specific class use the following query and substitute in the required table name, in this example MT_DBEngine is used to look for SQL alerts:
SELECT * FROM Alert WHERE BaseManagedEntityID IN (SELECT BaseManagedEntityID FROM MT_DBEngine)

– To determine which table is currently being written to for event and performance data use the following query:
SELECT * FROM PartitionTables WHERE IsCurrent = 1

– To retrieve events generated by a specific rule use the following query and substitute in the required rule ID:
SELECT * FROM Event_00 WHERE RuleId = (SELECT RuleId FROM Rules WHERE RuleName = ‘Microsoft.Windows.Server.2003.OperatingSystem.CleanShutdown.Collection ‘)

– To retrieve all events generated by rules in a specific Management Pack the following query can be used where the Management Pack name is substituted with the required value:
SELECT * FROM EventAllView
WHERE RuleID IN (SELECT RuleId FROM Rules WHERE
ManagementPackId =
(SELECT ManagementPackId FROM ManagementPack WHERE MPName = ‘Microsoft.Windows.Server.2003′))

– To retrieve all performance data for a given rule in a readable format use the following query:
SELECT pc.ObjectName, pc.CounterName, ps.PerfmonInstanceName, pd.SampleValue, pd.TimeSampled
FROM PerformanceDataAllView AS pd, PerformanceCounter AS pc, PerformanceSource AS
ps
WHERE pd.PerformanceSourceInternalId IN (SELECT PerformanceSourceInternalId FROM
PerformanceSource
WHERE RuleId = (SELECT RuleId FROM Rules WHERE RuleName =‘ Microsoft.Windows.Server.2003.LogicalDisk.FreeSpace.Collection’))

– Information on existing User Roles:
SELECT UserRoleName, IsSystem FROM userrole

– Grooming in the DataWarehouse:
– Grooming no longer uses SQL agent jobs.  Grooming is handled by scheduled stored procedures, that run much more frequently, which provides less impact than in the previous version.
– Default grooming for the DW for each dataset, to examine Data Warehouse grooming settings:
SELECT AggregationIntervalDurationMinutes, BuildAggregationStoredProcedureName, GroomStoredProcedureName, MaxDataAgeDays, GroomingIntervalMinutes FROM StandardDatasetAggregation

– The first row is the interval in minutes.
– NULL is raw data, 60 is hourly, and 1440 is daily.
– The second and third row shows what data it is
– MaxDataAgeDays has the retention period in days - this is the field to update if the administrator wants to lower the days of retention.
– RAW alert – 400 days
– RAW event – 100 days
– RAW perf – 10 days (hourly and daily perf = 400 days)
– RAW state – 180 days  (hourly and daily state = 400 days)

– AEM Queries (Data Warehouse):

– Default query to return all RAW AEM data:
SELECT * FROM [CM].[vCMAemRaw] Rw
INNER JOIN dbo.AemComputer Computer ON
Computer.AemComputerRowID = Rw.AemComputerRowID
INNER JOIN dbo.AemUser Usr ON
Usr.AemUserRowId = Rw.AemUserRowId
INNER JOIN dbo.AemErrorGroup EGrp ON
Egrp.ErrorGroupRowId = Rw.ErrorGroupRowId
INNER JOIN dbo.AemApplication App ON App.ApplicationRowId = Egrp.ApplicationRowId

– Count the raw crashes per day:
SELECT CONVERT(char(10), DateTime, 101) AS "Crash Date (by Day)", COUNT(*) AS "Number of Crashes"
FROM [CM].[vCMAemRaw]
GROUP BY CONVERT(char(10), DateTime, 101)
ORDER BY "Crash Date (by Day)" DESC

– Count the total number of raw crashes in the DW database:
SELECT count(*) FROM CM.vCMAemRaw

– Default grooming for the DW for the AEM dataset:  (Aggregated data kept for 400 days, RAW 30 days by default)
SELECT AggregationTypeID, BuildAggregationStoredProcedureName, GroomStoredProcedureName, MaxDataAgeDays, GroomingIntervalMinutes
FROM StandardDatasetAggregation WHERE BuildAggregationStoredProcedureName = ‘AemAggregate’


– MISCELLANEOUS SECTION –
—————————

– Simple query to display large tables, to determine what is taking up space in the database:
SELECT so.name,
8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) AS
data_kb,
Coalesce
(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0) AS
index_kb,
Coalesce
(8 * Sum(CASE WHEN si.indid IN (255) THEN si.reserved END), 0) AS
blob_kb
FROM dbo.sysobjects AS so JOIN dbo.sysindexes AS si ON (si.id = so.id)

WHERE ‘U’ = so.type GROUP BY so.name  ORDER BY data_kb DESC

– Is SQL broker enabled?
SELECT is_broker_enabled FROM sys.DATABASES WHERE name = ‘OperationsManager’

– How to identify your version of SQL server:
SELECT  SERVERPROPERTY(‘productversion’), SERVERPROPERTY (‘productlevel’), SERVERPROPERTY (‘edition’)

– SQL 2005:
– SQL Server 2005 RTM                    2005.90.1399
– SQL Server 2005 SP1                     2005.90.2047
– SQL Server 2005 SP1 plus 918222  2005.90.2153
– SQL Server 2005 SP2                     2005.90.3042

 

:
Posted by 커널64

getProcessNUM.vbs
arguement => Process1.exe,Process2.exe,Process3.exe......

Object : Process
Counter : NumberOfProcess
Instance : $Data/Property[@Name='ProcessName']$
Value : $Data/Property[@Name='PerfValue']$

--------------------------------------------------------------------------------------------------


Option Explicit
Const EVENT_TYPE_ERROR = 1
Const EVENT_TYPE_WARNING = 2
Const EVENT_TYPE_SUCCESS = 4

Dim intResponse, strProcess, bLogPerformanceEvent, bGenerateSuccessEvent, bLogPerformanceData
Dim oAPI, oArgs, cProcessResult, oMOMBag, sProcess, propertyBag, perfValue
Dim ProcessName
Set oArgs = WScript.Arguments
Set oAPI = CreateObject("MOM.ScriptAPI")
If oArgs.Count < 1 Then
Call oAPI.LogScriptEvent("getProcessNUM.vbs", 10101, EVENT_TYPE_ERROR, "getProcessNUM script was called with fewer than one arguement.")
WScript.Quit -1
End If

strProcess = Split(oArgs.Item(0), ",")
For Each sProcess In strProcess
getProcessNUM(sProcess)
Next
oAPI.ReturnItems

Sub getProcessNUM(ProcessName)
Set cProcessResult = GetObject("winmgmts://./root/cimv2").ExecQuery("SELECT * FROM Win32_Process WHERE name = '" & ProcessName & "'")
perfValue= 0.0
perfValue= cdbl(cProcessResult.count)
Set propertyBag = oAPI.CreatePropertyBag()
propertyBag.AddValue "ProcessName", ProcessName
propertyBag.AddValue "PerfValue", PerfValue
oAPI.AddItem(propertyBag)
Call oAPI.Return(propertyBag)
Set cProcessResult = Nothing
End Sub

:
Posted by 커널64
2009. 3. 18. 11:44

SCOM 2007 CrossPlatform Extension Overview SystemCenter2009. 3. 18. 11:44

사용자 삽입 이미지

OpenSSH:
developed by the OpenBSD Project, provides for secure communication between two systems, and delivers authentication, authorization, and confidentiality services. Operations Manager 2007 uses OpenSSH in several ways:
- During deployment, the secure copy (scp) capability of OpenSSH is used to securely copy the Ops Mgr Cross Plat agent to the target machine, and then initiate the agent and any required supporting processes (such as OpenPegasus and WS_Management) should they not be operational.
- During operations, should there be an issue with any of the supporting processes or should the agent process fail, Operations Manager 2007 can communicate with the managed system through OpenSSH and restart the failed service.
:
Posted by 커널64
2009. 3. 6. 22:39

SCOM 2007 Report 관련 쿼리 (보고서) SystemCenter2009. 3. 6. 22:39

' 성능 카운터 리스트 쿼리
SELECT ObjectName, CounterName, MultiInstanceInd FROM vPerformanceRule ORDER BY ObjectName

' Windows 컴퓨터 리스트 쿼리
SELECT Name FROM dbo.vManagedEntity WHERE ManagedEntityTypeRowId = '22' ORDER BY Name

' 성능 정보 쿼리 (데이터웨어하우스)
EXEC SP_PerfViewDaily '2009-02-01', '2009-02-20', 'Processor', '% Processor Time', 'Server1'

----------------------------------------------------------------------------------------------------------

CREATE PROCEDURE SP_PerfViewDaily
@StartDate DATETIME,
@EndDate DATETIME,
@ObjectName NCHAR(30),
@CounterName NCHAR(30),
@ServerName NCHAR(30)
AS
SELECT    
Dateadd (HH, 9, vPerf.DateTime) AS DateTime ,
vPerf.SampleCount,
Round (vPerf.AverageValue, 2) AS Average,
Round (vPerf.MinValue, 2) AS Minimum,
Round (vPerf.MaxValue, 2) AS Maximum,
Round (vPerf.StandardDeviation, 2) AS StandardDeviation,
vPerformanceRuleInstance.InstanceName,
vManagedEntity.Path AS ServerName,
vPerformanceRule.ObjectName,
vPerformanceRule.CounterName
FROM Perf.vPerfdaily AS vPerf INNER JOIN
vPerformanceRuleInstance ON vPerformanceRuleInstance.PerformanceRuleInstanceRowId = vPerf.PerformanceRuleInstanceRowId INNER JOIN
vManagedEntity ON vPerf.ManagedEntityRowId = vManagedEntity.ManagedEntityRowId INNER JOIN
vPerformanceRule ON vPerformanceRuleInstance.RuleRowId = vPerformanceRule.RuleRowId
WHERE vPerf.DateTime >= @StartDate
AND vPerf.DateTime < @EndDate
AND (vPerformanceRule.ObjectName IN (@ObjectName))
AND (vPerformanceRule.CounterName IN (@CounterName))
/* AND (vPerformanceRuleInstance.InstanceName IN ('')) */
AND (vManagedEntity.Path IN (@ServerName))
ORDER BY  DateTime
GO

:
Posted by 커널64
1. Copy the ResetSRS.exe file in SupportTools folder of the OM 2007 media to C:.
2. Open a Command Prompt and change your path to C:.
3. Type "ResetSRS.exe MSSQLSERVER" where MSSQLSERVER is your SQL instance name.
4. Then open Reporting Services Configuration Console, select Web Service Identity and click Apply.
5. Reinstall SCOM Reporting.
:
Posted by 커널64

Monitor -> New -> Scripting -> Timed Script Two State Monitor

Parameters
[Process1.exe] [Process2.exe] ....

State Expression
For Unhealthy Expression Property[@Name='State'] Equals Good
For Healthy Expresion Property[@Name='State'] Equals Bad

Alert Description
$Data/Context/Property[@Name='Message']$

---------------------------------------------------------------------------------------------------------------

ProcessRunCheck.vbs

Dim oAPI, oBag, oArgs, strProcess(), ProcessState()
strMessage = ""

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
Set oArgs = WScript.Arguments

ParamCount = oArgs.Count
State = 0

If ParamCount < 1 Then
Call oAPI.LogScriptEvent("ProcessRunCheck.vbs", 5009, 0, "Script aborted. Not enough parameters provided.")
WScript.Quit -1
End If

ReDim Preserve strProcess(ParamCount), ProcessState(ParamCount)

i = 0
Do While i <> ParamCount
strProcess(i) = oArgs(i)
i = i + 1
Loop

i = 0
Do While i <> ParamCount
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set ProcessState(i) = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = '" & strProcess(i) & "'")

If ProcessState(i).Count => 1 Then
Call oBag.Addvalue(strProcess(i),"Running(" & ProcessState(i).Count & "ea)")
strMessage = strMessage & strProcess(i) & ": " & "Running(" & ProcessState(i).Count & "ea)" & " | "
End If

If ProcessState(i).Count < 1 Then
Call oBag.Addvalue(strProcess(i),"Not running")
strMessage = strMessage & strProcess(i) & ": " & "Not running" & " | "
State = 1
End If

Set objWMIService = nothing
i = i + 1
Loop

If State = 0 Then
Call oBag.AddValue("State","Good")
Else
Call oBag.AddValue("State","Bad")
End If

Call oBag.AddValue("Message",strMessage)
Call oAPI.Return(oBag)

:
Posted by 커널64

SCOM 2007 Agent의 메시지 큐 크기 수정

기본값은 15MB인데 Exchange Server 2007과 같은 서버의 경우 너무 작을 수 있다.

과정
1. 레지스트리 편집기 실행
2. 다음 키로 이동
HKLM\SYSTEM\CurrentControlSet\Services\HealthService\Parameters\Management Groups\<ManagementGroupName>
3. MaximumQueueSizeKb 문자열 값 수정
(기본값은 15360으로 15MB -> 30720(10진수)이면 30MB
4. HealthService 재시작

:
Posted by 커널64
2009. 1. 24. 10:17

ManagementServerConfigTool의 용도 SystemCenter2009. 1. 24. 10:17

1. Creating Clustered RMS

ž   InstallCluster 명령은 클러스터된 RMS를 생성할 때 사용한다.

ž   DB를 제외한 모든 다른 작업보다 우선적으로 실행되어야 한다. (ex: Agent 배포 등)

ž   모든 클러스터 구성원 노드인 관리 서버에 동일하게 적용된다.

ž   RMS는 관리 그룹의 첫 번째 관리 서버이기 때문에 만일 추가 관리 서버와 Agent가 배포되어 있는 상황에서 작업을 진행할 경우 모든 관리 그룹에 혼란을 야기시킬 수 있다.

ž   이 명령은 데이터베이스의 클래스 구조와 모든 클러스터 노드가 RMS로 동작하도록 하기 위해 로컬 컴퓨터의 서비스, 레지스트리, 파일 구조를 변경한다.

ž   각각의 노드에 암호화 키를 복원하고 다음 명령을 실행한다.
ManagementServerConfigTool InstallCluster /vs:<VirtualClusterName> /Disk:<DiskLetter>

 

2. Adding Clustered RMS node

ž   AddVirtualServer 명령은 클러스터된 RMS에 노드를 추가할 때 사용한다.

ž   노드로 추가될 관리 서버에 암호화 키를 복원하고 다음과 같이 명령을 실행한다.
ManagementServerConfigTool AddRMSNode /vs:<VirtualClusterName> /Disk:<DiskLetter>

 

3. Promotion of a new MS to the RMS role

ž   PromoteRMS 명령은 관리 서버를 RMS role로 승격할 때 사용한다.

ž   RMS가 될 관리 서버에 암호화 키를 복원하고 ManagementServerConfigTool PromoteRMS 명령을 실행한다.

ž   Promotion 시 기존 RMS와의 연결(통신)이 가능하다면 기존 RMS는 자동으로 관리 서버로 demotion 된다.

ž   어떠한 이유로 인해 기존 RMS와 연결이 불가능한 경우 RMS에서 UpdateDemotedRMS 명령을 통해 수동으로 일반 관리 서버로 demotion 해야 한다.

ž   만약 PromoteRMS 후에 관리/수집 서버가 RMS와 통신하지 못하는 경우 각각의 관리/수집 서버에서 UpdateSecondaryMS 명령을 실행해 새로운 RMS의 위치를 찾을 수 있도록 해야 한다.

  

Windows Server 2003 클러스터에 SCOM RMS 설치
Windows Server 2008 장애조치 클러스터에 SCOM RMS 설치

:
Posted by 커널64
2009. 1. 21. 16:58

SCOM의 알림 메시지에 대한 파라미터 SystemCenter2009. 1. 21. 16:58

이벤트 규칙
EventDisplayNumber (Event ID): $Data/EventDisplayNumber$
EventDescription (Description): $Data/EventDescription$
Publisher Name (Event Source): $Data/PublisherName$
EventCategory: $Data/EventCategory$
LoggingComputer: $Data/LoggingComputer$
EventLevel: $Data/EventLevel$
Channel: $Data/Channel$
UserName: $Data/UserName$
EventNumber: $Data/EventNumber$

이벤트 모니터
EventDisplayNumber (Event ID): $Data/Context/EventDisplayNumber$
EventDescription (Description): $Data/Context/EventDescription$
Publisher Name (Event Source): $Data/Context/PublisherName$
EventCategory: $Data/Context/EventCategory$
LoggingComputer: $Data/Context/LoggingComputer$
EventLevel: $Data/Context/EventLevel$
Channel: $Data/Context/Channel$
UserName: $Data/Context/UserName$
EventNumber: $Data/Context/EventNumber$

반복 이벤트 모니터
EventDisplayNumber (Event ID): $Data/Context/Context/DataItem/EventDisplayNumber$
EventDescription (Description): $Data/Context/Context/DataItem/EventDescription$
Publisher Name (Event Source): $Data/Context/Context/DataItem/PublisherName$
EventCategory: $Data/Context/Context/DataItem/EventCategory$
LoggingComputer: $Data/Context/Context/DataItem/LoggingComputer$
EventLevel: $Data/Context/Context/DataItem/EventLevel$
Channel: $Data/Context/Context/DataItem/Channel$
UserName: $Data/Context/Context/DataItem/UserName$
EventNumber: $Data/Context/Context/DataItem/EventNumber$

성능 임계치 모니터
Object (Perf Object Name): $Data/Context/ObjectName$
Counter (Perf Counter Name): $Data/Context/CounterName$
Instance (Perf Instance Name): $Data/Context/InstanceName$
Value (Perf Counter Value): $Data/Context/Value$

서비스 모니터
Service Name: $Data/Context/Property[@Name='Name']$
Service Dependencies: $Data/Context/Property[@Name='Dependencies']$
Service Binary Path: $Data/Context/Property[@Name='BinaryPathName']$
Service Display Name: $Data/Context/Property[@Name='DisplayName']$
Service Description: $Data/Context/Property[@Name='Description']$

로그 파일 모니터
Logfile Directory: $Data/Context/LogFileDirectory$
Logfile name: $Data/Context/LogFileName$
String: $Data/Context/Params/Param[1]$

로그 파일 규칙
Logfile Directory: $Data/EventData/DataItem/LogFileDirectory$
Logfile name: $Data/EventData/DataItem/LogFileName$
String: $Data/EventData/DataItem/Params/Param[1]$

알림 (E-mail, IM, SMS 등)
AlertID GUID: $Data/Context/DataItem/AlertId$
Alert Name: $Data/Context/DataItem/AlertName$
Alert category: $Data/Context/DataItem/Category$
True/False: $Data/Context/DataItem/CreatedByMonitor$
CustomField1: $Data/Context/DataItem/Custom1$
CustomField2: $Data/Context/DataItem/Custom2$ ...
UTC Date/Time of Dataitem created: $Data/Context/DataItem/DataItemCreateTime$
LocalTime Date/Time of Dataitem created: $Data/Context/DataItem/DataItemCreateTimeLocal$
UTC Date/Time DataItem was modified: $Data/Context/DataItem/LastModified$
Local Date/Time DataItem was modified: $Data/Context/DataItem/LastModifiedLocal$
ManagedEntity GUID: $Data/Context/DataItem/ManagedEntity$
ManagedEntity Display name: $Data/Context/DataItem/ManagedEntityDisplayName$
ManagedEntity Full name: $Data/Context/DataItem/ManagedEntityFullName$
Managed Entity Path: $Data/Context/DataItem/ManagedEntityPath$
Alert Priority Number (High=1,Medium=2,Low=3): $Data/Context/DataItem/Priority$
Alert Owner: $Data/Context/DataItem/Owner$
Alert Repeat Count: $Data/Context/DataItem/RepeatCount$
Resolution state ID (0=New, 255= Closed): $Data/Context/DataItem/ResolutionState$
UTC Date/Time ResolutionState was last modified: $Data/Context/DataItem/ResolutionStateLastModified$
Local Date/Time ResolutionState was last modified: $Data/Context/DataItem/ResolutionStateLastModifiedLocal$
Resolution State Name (New, Closed): $Data/Context/DataItem/ResolutionStateName$
Person resolving the alert: $Data/Context/DataItem/ResolvedBy$
Alert Severity ID: $Data/Context/DataItem/Severity$
TicketID: $Data/Context/DataItem/TicketId$
UTC Time Added: $Data/Context/DataItem/TimeAdded$
Local Time Added: $Data/Context/DataItem/TimeAddedLocal$
UTC Time Raised: $Data/Context/DataItem/TimeRaised$
Local Time Raised: $Data/Context/DataItem/TimeRaisedLocal$
UTC Date/Time the Alert was resolved: $Data/Context/DataItem/TimeResolved$
Workflow ID (GUID): $Data/Context/DataItem/WorkflowId$
The Web Console URL: $Target/Property[Type="Notification!Microsoft.SystemCenter.AlertNotificationSubscriptionServer"/WebConsoleUrl$
Principalname of the management server: Target/Property[Type="Notification!Microsoft.SystemCenter.AlertNotificationSubscriptionServer"/PrincipalName$
Name of the recipient (e.g. the Email alias to which the notification is addressed): $Data/Recipients/To/Address/Address$

:
Posted by 커널64