2008年12月9日

SCOM 2007 R2 beta Unix Monitoring test

Unlike OpsMgr2007-CrossPlat-Beta, the Cross Platform monitor shipped with System Center Operations Manager 2007 R2 is easy to setup and ready to use(?) . And support SLES 9 & HP-UX 11iv2 now(I was looking for this).
OpsMgr2007 R2 beta crossplatform support(bold for new from OpsMgr2007-CrossPlat-Beta):

· AIX 5.3 (Power), 6.1 (Power)
· HP-UX 11iv2 (PA-RISC & IA64), and 11iv3 (PA-RISC, and IA64)
· Red Hat Enterprise Server 4 and 5
· Solaris 8 (SPARC), 9 (SPARC), and 10 (SPARC & x86 versions later than 120012-14)
· SUSE Linux Enterprise Server 9 and 10 SP1
· Linux 64-bit is not supported in this release.

I've setup a R2 beta env for a Suse 10 sp1, no special to say but remember to read the"Step by step guide to monitoring UNIX and Linux computers using operations manager 2007 R2".

2008年11月11日

最近新出的 SCOM2007的Management Pack

MP:Windows Server 2000/2003/2008 Active Directory
Release:11/7/2008 (6.0.6452.0)
Link:http://www.microsoft.com/downloads/details.aspx?FamilyId=008F58A6-DC67-4E59-95C6-D7C7C34A1447&displaylang=en&displaylang=en

MP:Windows DHCP Server 2000/2003/2008
Release:11/7/2008(6.0.6452.0)
Link:http://www.microsoft.com/downloads/details.aspx?FamilyId=2694E87C-76E0-417B-AD0F-5897E46FFF88&displaylang=en&displaylang=en

MP:SQL Server MP for OpsMgr 2007
Release:10/29/2008(6.0.6441.0)
Link:http://www.microsoft.com/downloads/details.aspx?FamilyId=8C0F970E-C653-4C15-9E51-6A6CADFCA363&displaylang=en&displaylang=en

News for System Center Operations Manager 2007 R2

This is one of the most exciting demo's I've seen. Barry is on the
Operations Manager team - he does cross platform stuff. In this demo - the
same one shown during Bob Muglia's MMS Keynote - Barry uses Ops Man to manage an
application that is spread across SQL Server, Oracle, MySQL, Apache, and IIS,
hosted on Windows, Solaris, Suse, and Redhat. All using open standards for
management.


http://mschnlnine.vo.llnwd.net/d1/edge/6/4/8/barry1_2MB_edge.wmv

2008年11月8日

TechEd 2008 Session MG310 安装证书脚本

if {%1} equ {/?} goto USAGEif {%1} equ {-?} goto USAGEif {%1} equ {?} goto USAGEif {%1} equ {} goto USAGE
set subjectname=%1set certpath=%systemdrive%\OMCertificates
mkdir %certpath%
rem Get the CA's certcertutil -f -config dc.lan.com\SCOMCA -ca.cert %certpath%\CACertificate.cer
rem Move the CA's cert to the "Trusted Root Authorities" storecertutil -f -addstore Root %certpath%\CACertificate.cer
rem Create an INF request file with the specified subjectnamedel %certpath%\RequestConfig.infecho [NewRequest] > %certpath%\RequestConfig.infecho Subject="CN=%subjectname%" >> %certpath%\RequestConfig.infecho Exportable=TRUE >> %certpath%\RequestConfig.infecho KeyLength=1024 >> %certpath%\RequestConfig.infecho KeySpec=1 >> %certpath%\RequestConfig.infecho KeyUsage=0xf0 >> %certpath%\RequestConfig.infecho MachineKeySet=TRUE >> %certpath%\RequestConfig.infecho [EnhancedKeyUsageExtension] >> %certpath%\RequestConfig.infecho OID=1.3.6.1.5.5.7.3.1 >> %certpath%\RequestConfig.infecho OID=1.3.6.1.5.5.7.3.2 >> %certpath%\RequestConfig.inf
rem Create a binary request file from the INF
del %certpath%\BinaryRequest.reqCertReq -New -f %certpath%\RequestConfig.inf %certpath%\BinaryRequest.req
rem Submit the request to our CA and save the certificateCertReq -Submit -f -config "dc.lan.com\SCOMCA" %certpath%\BinaryRequest.req %certpath%\NewCertificate.cer
rem This step needed to import the private key. Also puts the certificate in the local computer personal store.certreq -accept %certpath%\NewCertificate.cer
MOMCertImport.exe /SubjectName %subjectname%
goto END
:USAGEecho.echo GetCert.cmd FQDN_of_machineecho Example: GetCert.cmd Computer01.Contoso.comecho Gets and installs a cert from CA cahost.contoso.com (CorpCA) appropriate for OMv3, and also gets and installs CA cert so this CA is trusted.echo.
:END

TechEd 2008 Session MG310 视频Demo2 - 维护窗口

下载地址:
http://lovelord.3adisk.com/ 选择WBMM_New_Final.avi 维护窗口

TechEd 2008 Session MG310 视频Demo1 - 证书通讯

视频下载地址:
http://lovelord.3adisk.com/ 选择Cert_import.avi 证书通讯。

2008年10月13日

如何把agent进入maintain模式

SCOM2007的最大特点之一就是面向对象的监控,而不同于MOM2005的面向服务器的监控。换句话说,如果我们的服务依赖多台服务器,或一台服务器上Host了多个服务,在MOM2005里是没法做到颗粒监控的。
如果你看了前面的文章,就会了解SCOM2007是按照对象来设置maintain模式的,而如果要把一台server进入maintain模式,应该怎么做呢,答案是把与server相关的三个对象设置到maintain模式,他们分别是:computer,health service和health service watcher,下面的代码说明了这个问题:

MonitoringObject[] monObjects = new MonitoringObject[3];
ManagementGroupAdministration administration = mg.GetAdministration();
AgentManagedComputerCriteria criteria = new AgentManagedComputerCriteria("Name = '" + serverName + "'");
ReadOnlyCollection agentManagedComputers = administration.GetAgentManagedComputers(criteria);
MonitoringObject monitoringObject = mg.GetMonitoringObject(agentManagedComputers[0].Id);
MonitoringObject hostedHealthService = agentManagedComputers[0].HostedHealthService;
monObjects[0] = monitoringObject;
monObjects[1] = hostedHealthService;
String query = "DisplayName = 'Health Service Watcher'";
MonitoringClassCriteria classCriteria = new MonitoringClassCriteria(query);
ReadOnlyCollection monClasses = mg.GetMonitoringClasses(classCriteria);
List listObjects = new List();
foreach (MonitoringClass monClass in monClasses)
listObjects.AddRange(mg.GetMonitoringObjects(monClass));
foreach (MonitoringObject monObject in listObjects)
if (monObject.DisplayName.ToUpper() == serverName.ToUpper())
monObjects[2] = monObject;
foreach (MonitoringObject monObject in monObjects)
monObject.ScheduleMaintenanceMode(DateTime.Now.ToUniversalTime(), Convert.ToDateTime(endTime).ToUniversalTime(), GetReason(reason), comment);

这样agent就被设置到maintain模式了。但是并没有把host在这台服务器上的IIS或SQL服务也设置到maintain模式,如果想把这台server下所有的服务也设置到maintain,应该这样用

monObject.ScheduleMaintenanceMode(DateTime.Now.ToUniversalTime(), Convert.ToDateTime(endTime).ToUniversalTime(), GetReason(reason), comment, TraversalDepth.Recursive);

多了一个叫做TraversalDepth的参数,这个参数有两个值,分别是:OneLevel和Recursive,如果要把对象下的所有子对象都设置maintain,应该使用TraversalDepth.Recursive。

说了这么多,应该提醒大家的是, SCOM2007已经提供了面向对象的监控,我们就应该用好这个特性,做好面向服务的监控。

2008年9月4日

为什么SQL Server进程会消耗大量的CPU资源

今天终于解开了很长时间的困扰:DB服务器的SQL Server进程占用CPU资源高的问题。我们发现当新的MP安装后,或者创建新的组之后,或者新建overrides后,DB服务器的CPU使用率总是会特别高,消耗CPU资源的是operation db所在的SQL Server Instance的进程。

前天,9月2日,Microsoft出了新的KB,解释了这个现象:由于SCOM 2007的数据访问层组件会强制SQL Server重建执行plan,所以造成SQL Server的大量计算。微软同时提供了hotfix修复了这个问题。详细信息:The SQL Server process may consume lots of CPU resources on the server that hosts the Operations Manager 2007 database after you make Operations Manager 2007 configuration changes

2008年8月14日

SCOM 2007 Data Warehouse Migration Guide (数据仓库迁移指南)

随着MP和被管理Agent数量的增加,Data Warehouse的数据增长很快,所以迁移Data Warehouse一方面是为了获得更好的处理性能,另一方面是为了获得更好的存储能力。基本上我把迁移分成了15步,第1步和第15步可以省略,其它步骤均有详细说明。对于120G大小的数据,4CPU*2.83GHz, 8G内存的环境预计所用时间为2.5~3小时。




Detail step

1. Stop SCOM server service
a. On the Root Management Server, stop the OpsMgr Config Service and Opsmgr SDK service.
b. On all Management Servers, stop the OpsMgr Health Service.

2. On the old DW server, backup OpsMgrDW and take it offline
a. Backup OpsMgrDW, and ensure backup success.
b. Take offline OpsMgrDW.

3. On the new DW server, restore OpsMgrDW
a. Copying the backup to a local drive.
b. Restore the OperationsManagerDW database from backup.

4. Create service account in new DW
a. Use SQL Management Studio connect to the new Data Warehouse server.
b. Create a login for the OpsMgr SDK Service account, the Data Warehouse Action Account, and the Data Reader Account.
( or run sql
USE [master]
GO
CREATE LOGIN [CN001\OMSDKCSA] FROM WINDOWS WITH DEFAULT_DATABASE=[master]
GO
CREATE LOGIN [CN001\OMDRA] FROM WINDOWS WITH DEFAULT_DATABASE=[master]
GO
CREATE LOGIN [CN001\OMDWWA] FROM WINDOWS WITH DEFAULT_DATABASE=[master]
GO
)

5. Update login permission for SDK service account
a. In Microsoft SQL Server Management Studio, in the Object Explorer pane, navigate to Security and then expand Logins.
b. Right-click on the account that corresponds to the computer on which the SDK Service is. Select Properties.
c. In the Login Properties dialog box, in the Select a page pane, select User Mapping.
d. In the Users mapped to this login list, In the Map column, check the box that corresponds to the OperationsManagerDW database.
e. In the Database role membership for: OperationsManagerDW list, check OpsMgrReader.
f. Click OK to save your changes and to close the Login Properties dialog box.

6. Update login permission for Data Reader Account
a. In Microsoft SQL Server Management Studio, in the Object Explorer pane, navigate to Security and then expand Logins.
b. Right-click on the Data Reader Account.
c. In the Login Properties dialog box, in the Select a page pane, select User Mapping.
d. In the Users mapped to this login list, In the Map column, check the box that corresponds to OperationsManagerDW.
e. In the Database role membership for: OperationsManagerDW list, check OpsMgrReader.
f. Click OK to save your changes and to close the Login Properties dialog box.

7. Update login permission for Data Warehouse Action Account
a. In Microsoft SQL Server Management Studio, in the Object Explorer pane, navigate to Security and then expand Logins.
b. Right-click the Data Warehouse Action Account.
c. In the Login Properties dialog box, in the Select a page pane, select User Mapping.
d. In the Users mapped to this login list, In the Map column, check the box that corresponds to OperationsManagerDW.
e. In the Database role membership for: OperationsManagerDW list, check the following items: OpsMgrWriter and db_owner.
f. Click OK to save your changes and to close the Login Properties dialog box.

8. Configure the name of the new Data Warehouse server in DB
a. On the server that hosts the OperationsManager database, open SQL Server Management Studio and navigate to Databases, OperationsManager, and then to Tables.
b. Right-click dbo.MT_DataWarehouse, and then select Open Table.
c. Change the value in the MainDatabaseServerName_16781F33_F72D_033C_1DF4_65A2AFF32CA3 column to the name of the new Data Warehouse server.
d. Close SQL Server Management Studio to save your changes.

9. Configure the name of the new Data Warehouse server in DW
a. On the new Data Warehouse server, open SQL Server Management Studio and navigate to Databases, OperationsManagerDW, and then to Tables.
b. Right-click dbo.MemberDatabase table and select Open Table.
c. Change the value in the ServerName column to the name of the new Data Warehouse server.
d. Close SQL Server Management Studio to save your changes.

10. Update reporting server data source Data Warehouse Main
a. Use SQL Management Studio connect to the OpsMgr reporting service.
b. Open home, Right-click Data Warehouse Main select properties, select connection tab, update connection string to the new Data Warehouse server.

11. Start the OpsMgr SDK Service on RMS
a. On the Root Management Server, start the Opsmgr SDK service.

12. Confirm Data Warehouse Action Account
a. Open SCOM console -> Administration -> Security -> Run As account
b. Confirm if data warehouse action account is the same as the writerloginName column in the managementgroup table in data warehouse database

13. Start Service (Config, Health) on RMS and every MS
a. On the Root Management Server, start the OpsMgr Config Service.
b. On all Management Servers, start the OpsMgr Health Service.

2008年7月17日

使用AD集成部署SCOM2007的Agent - Part II

使用AD集成部署SCOM2007的Agent
1. 创建管理组和特权帐号。
2. 运行MOMADAdmin.exe工具来在Domain里创建OperationsManager 对象。
3. 在Operations Manager Console里来配置Management Server Failover。
4. 批量安装agent。

详细步骤:
创建管理组和特权帐号:

1. 在AD里创建一个服务帐号(Service Account)并设置为密码永不过期。
2. 在SCOM 控制台Administration里创建Run As Accounts,取名为Assignment Account


3. 把创建好的Assignment Account 关联到Run As Profiles里的Active Directory Based Agent Assignment Account。


4. 在AD里创建一个全局的安全组,把刚才创建的服务帐号加到这个组里来并且把这个组加入到SCOM User Role 的Operations Manager Administrators里。


运行MOMADAdmin.exe(MOM AD Configuration Tool) 配置
1. 从SCOM光盘上SupportTools文件夹中复制MOMADAdmin.exe到一台DC (Domain Controller)上。
2. 用Domain Admin身份运行MOMADAdmin.exe, 参数如下:
MomADAdmin.exe \ \
实例:
MomADAdmin.exe CW "testlab\OPSMGR Admin" testlab\momad testlab
3. 系统会自动在AD里创建出一个名为OperationsManager的容器(Container)。


在Operations Manager Console里来配置Failover
1. 进入到Operations Manager Console, 打开Administration, 单击Configure Active Directory (AD) Intergration.


2. 选择你要配置的Management Server,然后点击Add.


3. 选择Domain保留默认选项,点击Next


4. 创建Inclusion Criteria, 点击Configure按钮。
5. 在Find Computer界面中, 用Advanced Tab 里来创建Query,然后点击OK.
在这个实例里我们想query出以Server为开始的Computer名字。


6. 在Inclusion Criteria界面中query 语句显示如下:
(&(sAMAccountType=805306369)(objectCategory=computer)(samAccountName=Server*))。如果你需要更多的查询条件请参考微软的Creating an LDAP Query Filter (
http://msdn2.microsoft.com/en-us/library/ms675768.aspx
7. 在Exclusion Criteria 界面中,你可以输入想要排除的机器名(一定要是FQDN名字),点击Next
8. 在Agent Failover 中, 你可以选择自动或者手动Failover到另外一Management Server 上,点击Save来完成操作。
9. 默认情况下SCOM会在一个小时以后在OperationsManager容器里创建相关的组,并且会把Query出来的机器自动加入到这个组里来。
10. 在Administration 里选择Settings,然后选择Security.然后选择Review new manual agent installations in pending management view.


批量安装agent
1. 自动安装Agent, 把以下的命令做成Script放到SMS或者Group Policy里
momagent.msi /qn USE_SETTINGS_FROM_AD=1 USE_MANUALLY_SPECIFIED_SETTINGS=0
2. 在Operations Manager Console里面的Pending Management 来Approval 请求.
(全文完)

2008年7月14日

使用AD集成部署SCOM2007的Agent - Part I

System Center Operations Manager 2007(SCOM2007)为企业的IT运维提供了一套监控和决策支持解决方案:不但可以全面监控组织中的IT环境健康状况,更提供了修复问题或避免潜在问题的机制。目前全球以及中国已经有越来越多的企业采用了SCOM2007解决方案。本文作者介绍了如何利用SCOM2007提供的AD集成特性,更加安全、自动化的部署SCOM2007的Agent,使Agent能够自动连接到管理服务器(MS),以实现合理的负载均衡和管理策略。文中使用的缩略语如无特殊标注,所表示的含义如下:

· SCOM2007 - System Center Operations Manager 2007
· RMS - Root Management Server
· MS - Management Server
· Agent - Operations Manager Agent
· Console - Operations Manager Console
· MP - Operations Manager Management Pack
· AD - Acitve Directory

SCOM2007在企业中的典型部署方式典型的企业部署方式采用了多MS模式。如下图所示,被管理的计算机通过Agent组件向MS发送所管理系统的事件、运行的性能、服务的状态等信息,MS向RMS转发数据,RMS负责把收集到的数据记录到数据库中,系统管理员和操作员通过console访问数据库查看被管理系统的当前运行状况、历史报告等,也可以通过console定义所需管理的规则、对问题的处理方法等。

需要系统架构师注意的是,中间的这一层即MS的作用。表面上它起到了收集Agent数据和分发MP的作用,然而更重要的是在企业的应用中它起到了负载均衡和自动Failover的作用。如图一所示,架构师可以根据企业环境中的网络、主机性能、地理位置、管理员、服务器管理策略等因素,综合考虑把Agent分配到不同的MS上。而且,通过配置Failover选项,能够实现当某台MS发生故障时,由其它MS接管它的工作。如图一的虚线部分所示,即实现了Agent的自动Failover,当发生故障的MS恢复后还可以实现自动Failback。采用这种架构极大地提高了监控平台的高可用性和高可扩展性,能够帮助管理员更高效地利用他们的时间,以此降低企业的管理成本并提高企业竞争力。

部署方案确定后,需要解决的是如何部署Agent的问题。SCOM2007提供了两种Agent的部署方法,一是通过Console提供的Discover and Deploy方式部署,二是通过执行MOMAgent.msi安装包文件部署。针对上面的部署方案,我们有以下几个需求要满足:
1. Agent部署后会与指定的MS(Primary)交互
2. 当某MS发生故障时,Agent能够自动Failover到另一MS(Secondary)
3. 管理员能够实现高效的管理
虽然通过Discover and Deploy部署方式,管理员能够实现前面两个需求,但当企业监控的服务器数量较多、甚至很多的时候,管理员面临的是巨大的人工操作,而且必须保证每次配置必须准确,这无疑提高了正确管理的风险。为了降低这种潜在的风险,我们选择通过运行安装脚本文件执行MOMAgent.msi安装包文件部署。
利用SCOM2007提供的AD集成特性,管理员可以提前在AD中配置好各个Agent的Primary MS和Secondary MS信息,编写好安装脚本文件,然后在所需部署Agent的计算机上运行这个安装脚本,就可以实现Agent的部署并满足以上三个需求。在笔者的公司由于采用System Center Configuration Manager,更是实现了大规模的自动安装部署。

(未完待续)

2008年6月28日

基于模型的设计思想(Model-Based Design)第二篇

在使用SCOM 2007的时候,不一定要了解“基于模型的设计思想”这个概念,但是如果想要得心应手的使用MP,或者你想要开发属于自己的MP,那么这个概念你必须有透彻的认识。有太多的理由让我们开发自定义的MP,换句话说,有太多的理由让我们认真学习“基于模型的设计思想”这个概念。所以我想用一组系列的文章来帮助大家更透彻的认识它。本文是这一系列文章的第二篇,“服务模型”和“健康模型”。

上一篇我们认识了SCOM 2007是用XML语言描述的一个对象的模型。这个模型包括了“服务模型”和“健康模型”,这一篇我们来看看什么是“服务模型”和“健康模型”。

“服务模型”(Service Model)描述了被监控对象的组成部分。比如要监控某种数据库服务,对应有一个模型叫数据库服务,这个模型可能由数据库引擎服务、报表服务、分析服务、数据库实例、数据库等部分组成,这些部分可以是这个模型的特有属性,也可以是其它的模型。

“服务模型”有三种关系,从属(Hosting)、包含(Containment)和涉及(Reference)。比如数据库实例和数据库之间是从属关系,实例包含数据库且某一个数据库只能属于一个实例;数据库实例组和数据库实例之间是包含关系,实例组包含实例但某一个实例可以属于不同的实例组,比如HR实例组、北方区实例组;数据库服务和操作系统之间则是涉及关系,数据库服务这个模型涉及了操作系统这个模型。

“健康模型”(Health Model)描述了被监控对象的健康状况与这个对象的组成部分健康状况之间的关系。比如:数据库服务的健康状况与多个数据库实例相关,如果某个数据库实例有问题,则该数据库服务有问题;只有所有的数据库实例健康,该数据库服务才健康。

如果能够对照SCOM 2007的Console里的“Health Explorer”来理解的话,一定会比只读这些文字有效的多。第二篇就到这里了,下次再聊。

2008年6月22日

基于模型的设计思想(Model-Based Design)第一篇

在使用SCOM 2007的时候,不一定要了解“基于模型的设计思想”这个概念,但是如果想要得心应手的使用MP,或者你想要开发属于自己的MP,那么这个概念你必须有透彻的认识。有太多的理由让我们开发自定义的MP,换句话说,有太多的理由让我们认真学习“基于模型的设计思想”这个概念。所以我想用一组系列的文章来帮助大家更透彻的认识它。本文是这一系列文章的第一篇,认识“SCOM 2007中的模型”。


偏感性认识“模型”
在SCOM 2007中,所有被管理的对象比如硬件、软件、服务等都被描述为逻辑模型。比如要监控磁盘,那么一定有一个模型叫磁盘;要监控操作系统那么一定有一个模型叫操作系统;要监控邮件服务,那么一定有一个模型叫邮件服务。之所以称他们为逻辑模型,一因为他们与物理设备无关,比如邮件服务,可以依赖多台服务器的操作系统,可以包含多个磁盘;二因为他们可以对应多个实例,比如操作系统这个模型,可以对应到Server1的操作系统,也可以对应到Server2、Server3的操作系统。

偏理性认识“模型”
有了上面的描述,因该了解到“模型”其实就是一个被监控的逻辑单元。如果你做过面向对象的软件设计,那么可以对比一下“类”的概念;如果你做过系统架构设计(抽象层),可以对比一下“组件”的概念。当然,微软也给出了一个定义:A model is a computer-consumable representation of software or hardware components that captures the nature of the components and the relationships between them. 这一下,我们可以清楚地看到:“模型”是包含了特性的组件,“模型”之间存在着关系。举个例子:邮件服务是一个模型,它可能涉及到多个其它模型,比如邮件服务器、前端服务器、操作系统、磁盘、域控服务器、DNS服务器等,那么监控一个邮件服务器健康状态就需要监控这些组件的健康状态。我们一起来延伸一下:我们要定义邮件服务这个模型,必须首先定义好其它的那些模型,或者说那些模型已经在其他的MP中定义好了,我们只需引用便可。

再深入认识“模型”
上面两段对“模型”的认识,还是停留在概念的阶段,那么现在就来看看这个“模型”的真面目吧。在SCOM 2007中MP包含了“模型”的定义、“模型”的健康状态定义、管理“模型”的知识等等信息。一个MP就是一个XML文档,所以说“模型”就是一段XML语言。

第一篇就到这里了,下次再聊。