This posting is provided "AS IS" with no warranties.
Friday, November 22, 2013
[OpsMgr 2012] Is VMPD working on Microsoft Visio 2013 Professional ? (#VMPD #Authoring #Opsmgr )
Monday, May 13, 2013
[OpsMgr 2012] Boris Yanushpolsky 's Tools by Daniele Muscetta - New update
Here is the latest update from Daniele :
- May 9th 2013 with MPViewer 2.3 that now can also handle MP Bundles that contain multiple ManagementPacks in a single bundle.
Get latest updates directly on : http://blogs.msdn.com/b/dmuscett/archive/2012/02/19/boris-s-tools-updated.aspx
This posting is provided "AS IS" with no warranties.
Thursday, April 4, 2013
[OpsMgr 2012] VSAE – Include File Content
The include syntax in this example is $IncludeFileContent/Scripts/MonitoringScript.vbs$, and this is generated based on the path of the file. In this MP, I stored the VBS file in a folder called Scripts, which is why “Scripts/MonitoringScript.vbs” is added to “IncludeFileContent”.
This posting is provided "AS IS" with no warranties.
Friday, October 19, 2012
[OpsMgr 2007R2][OpsMgr 2012] Management Pack samples - Authoring
Sample management pack for Operations Manager 2007 and System Center 2012 Operations Manager.
This management pack provides an example of configuring monitors and rules to run only during business hours. Examples are provided for a service monitor, a monitor running a script, and monitors and rules based on a Windows event. Two different monitor types are used for events. These have identical functionality but illustrate two different strategies for configuring monitor types.
Each monitor and rule must specify parameters for the System.ScheduleFilter module. StartTime and EndTime provide the time that the monitor or rule should begin functioning, while EndTime specifies the time that it should stop functioning. DaysOfWeekMask specifies the days of the week that the schedule applies to as described in the following article: http://msdn.microsoft.com/en-us/library/ee692976(v=MSDN.10).aspx.
Both event monitors trigger a critical state from an event with a number of 101 and a source of EventCreate. They return to healthy with an event number of 102. The service monitor watches the running state of the Alerter service, The script monitor will set a state according to the Successful parameter on the monitor type. If the Successful parameter is false, then a critical state is set. If the Succesful parameter is true, then a healthy state is set.
All rules and monitors are targeted at a class called MPAuthor.BusinessHours.Target. This is discovered by creating a registry key at HKLM\SOFTWARE\MPAuthor\BusinessHours. This registry key must be on the same agent computer where the test events are created.
This is a sample management pack for Operations Manager 2007 R2.
This management pack provides an example of monitoring network devices. This includes providing custom monitoring for different brands of SNMP devices and monitoring Syslog mesages from devices that do not support SNMP.
A class is created for each type of SNMP device based on Microsoft.SystemCenter.NetworkDevice. This provides a target for monitors and rules specific to each type. For devices that do not support SNMP, a class is created based on System.HardwareComponent. A device for each type of device is created based on this class that provides the target for monitors and rules specific to that type.
Discovery for SNMP devices is targeted at Microsoft.SystemCenter.NetworkDevice since this represents network devices that have already been discovered. The name of the target is used to determine the type of device and which class should be created. Discovery for devices not supporting SNMP is performed from a text log that lists the Name, IP Address, and Type for each device to discover. This discovery is targeted at a proxy agent that is discovered from a registry key at HKLM\SOFTWARE\MPAuthor\NetworkDevices. This registry key must also contain a value called ConfigFIle that contains a path to the configuration file.
The classes for the devices are all unhosted. Unhosted object are typically managed on the RMS, but the discovery scripts create a special containment relationship that causes the object to be managed on the proxy agent. Any monitors or rules targeted at these classes are loaded on the agent computer. The managed devices should be configured to send SNMP traps and Syslog messages to the proxy agent.
This is a sample management pack for Operations Manager 2007 R2 and System Center 2012 Operations Manager.
This management pack provides an example of a script returning multiple values in a property bag. A single monitor type is used that accepts a parameter to specify the desired property. Also illustrated is the use of data source modules returning different data types. Rules and monitors can use the data source returning the type they require, while they all share the same script.
The script collects different pieces of data from a file. The name of the file must be specified in the FileName parameter of any rule or monitor.
All rules and monitors are targeted at a class called MPAuthor.PropertyBag.Target. This is discovered by creating a registry key at HKLM\SOFTWARE\MPAuthor\PropertyBag. This registry key must be on the same agent computer with the file.
This is a sample management pack for Operations Manager 2007 R2 and System Center 2012 Operations Manager.
This management pack provides an example of a recovery running after a diagnostic. The recovery only runs if specific criteria is received from the diagnostic output. It also illustrates how to pass property bag data from the monitor to the diagnostic and the recovery.
In this example, the diagnostic runs in response to a service monitor. If the specified service is stopped, then the diagnostic runs. The service used is the WMI Performance Adapter (WmiApSrv), but this can be changed in the properties of the monitor. The diagnostic runs a script that collects an error code value from the registry at HKLM\SOFTWARE\MPAuthor\DiagnosticAndRecovery\ErrorCode. If the error code is 3, then the recovery will run. If it is any other value, the recovery will not run. The recovery is a script that restarts the service.
A sample diagnostic and recovery are provided for both VBScript and PowerShell. The functionality of each are identical and only one of the diagnostics should be enabled at a time.
This is a sample management pack for Operations Manager 2007 R2 and System Center 2012 Operations Manager.
This management pack provides an example of a script processing the output of a data source. The data source is followed by a probe action that changes the output data type to a property bag. Monitors and rules using the data type specify the property bag values that they require. Two samples are provided, one using Windows PowerShell and the other using VBScript.
The specific example expects XML in the description of an event. This simulates a condition where all errors in the application create a Windows event with the same name number and source. The XML includes the specific number and description of the error. The expected XML format is below. Sample rules expect an event with a number of 101 and a source of EventCreate. The EventCreate utility can be used to create sample events.
All rules and monitors are targeted at a class called MPAuthor.ProcessDataSource.PowerShell.Target or MPAuthor.ProcessDataSource.VBScript.Target. This is discovered by creating a registry key at HKLM\SOFTWARE\MPAuthor\ProcessDataSource. This registry key must be on the same agent computer that the sample event is created on.
This is a sample management pack for Operations Manager 2007 R2 and System Center 2012 Operations Manager.
This management pack provides an example of a monitor based on a registry value. A monitor type is included that will periodically check a specified registry value and compare it to a desired value. The monitor provides the path to the value, the duration to check, and the value to compare it to.
The included monitor checks the value at HKLM\SOFTWARE\MPAuthor\RegistryMonitor\TestValue and sets the monitor to a critical state if the value is not "ThisValue". A different registry value and desired value can be used by changing the configuration of the monitor.
All rules and monitors are targeted at a class called MPAuthor.RegistryMonitor.Target. This is discovered by creating a registry key at HKLM\SOFTWARE\MPAuthor\RegisterMonitor. This registry key must be on the same agent with the registry value being checked.
This is a sample management pack for Operations Manager 2007 R2 and System Center 2012 Operations Manager.
This management pack provides an example of linked reports. Two linked reports are included as follows:
Availability Report - The user is not required to provide values for any of the parameters other than the objects. The data included is from the previous seven days. The dialog box to select the objects is filtered to only include instances of MPAuthor.LinkedReports.Target.
Performance Report - The user must select the object and date range but does not need to select the details of the report. It is configured to include performance data from two rules - MPAuthor.LinkedReports.CollectScriptPerformance and MPAuthor.LinkedReports.CollectWMIPerformance.
All rules and monitors are targeted at a class called MPAuthor.LinkedReports.Target. This is discovered by creating a registry key at HKLM\SOFTWARE\MPAuthor\LinkedReports. This registry key must be on at least one agent computer. The sample rules and monitor will run on these agents.
This is a sample management pack for Operations Manager 2007 R2 and System Center 2012 Operations Manager.
This management pack provides an example of workflows running scripts that support cookdown. Two example rules are provided in both VBScript and PowerShell with with one supporting cookdown and the other not supporting cookdown.
The sample rules collect as performance data the file size for all files in a specified folder. The rules are targeted at the class MPAuthor.Cookdown.File, so the agent will run a separate instance of the rule for every file. The data source module for the rule not supporting cookdown requires the path of the file as a parameter. Since this will be different for every instance, the module cannot cookdown. The first data source module for the rule supporting cookdown also requires the file path, but this is used in a condition detection module. The data source module running the script does not require this parameter. Since the folder path parameter will be the same for all files, that data source module does cookdown.
Each rule will create an event in the Operations Manager event log to verify each running instance. The rules that cookdown should create a single event while the rules not supporting cookdown should create multiple events. Each of the rules is disabled and needs to be enabled before they run.
The event numbers created are as follows:
821 - No Cookdown - VBScript
822 - Cookdown - VBScript
823 - No Cookdown - PowerShell
824 - Cookdown - PowerShell
The discovery for MPAuthor.Cookdown.File is targeted at a class called MPAuthor.Cookdown.Target. This is discovered by creating a registry key at HKLM\SOFTWARE\MPAuthor\Cookdown. This key must have a value named FolderPath that contains the path of the folder containing the files. The folder must exist on the agent computer and contain one or more files to discover.
This is a sample management pack for Operations Manager 2007 R2 and System Center 2012 Operations Manager.
This management pack provides several examples of different kinds of discovery. Several classes and relationships are included in the management pack to support the sample discoveries. A basic description is provided for each below, and a more complete description is provided for each Discovery in the management pack.
- Registry Discovery
Creates an instance of a particular class if certain conditions are true.
- Script Discovery
Script to discover instances of a particular class.
- Script Discovery for Unhosted Class
Script to discover instances of an unhosted class.
- WMI Discovery
WMI discovery to discover instances of a particular class.
- Discover Containment Relationship with Script
Script to discover instances of a containment relationship. A script is used because logic is required to parse the a property collected from a registry value.
- Discover Containment Relationship with Registry
Discover a containment relationship from registry values without using a script. This discovery can only be used when the property value collected from the registry does not need to be parsed.
- Group Population for a Group
Uses GroupPopulator to populate a group with all instances of a particular class.
- Group Population for Distributed Application
Uses GroupPopulator to populate a distributed application with all instances of a particular class.
- Group Population for Computer Group
Uses GroupPopulator to populate the a group with all instances of Microsoft.Windows.Computer that have an instance of another class.dfg
This posting is provided "AS IS" with no warranties.
[OpsMgr 2007R2][OpsMgr 2012] Basic Troubleshooting Discovery Script
There are many ways to troubleshoot this discovery process, this will cover the “basics”.
- Verify that MP has been committed on agent
- Check agent for eventlog errors
- Check management server for errors
- Verify that discovery is running
- Enable debug events in script
- Debug script on agent
In my side, the first article I've posted was :
This posting is provided "AS IS" with no warranties.
Monday, October 8, 2012
[SCOM 2007] Authoring Management Pack - Create a VBS discovery with a debugging functionnality - PART III
This posting is provided "AS IS" with no warranties.
Monday, October 1, 2012
[OpsMgr 2007 R2][OpsMgr 2012] Authoring performance collection rules for cluster disks – the *RIGHT* way.
This posting is provided "AS IS" with no warranties.
Thursday, September 6, 2012
[OpsMgr 2007R2][OpsMgr 2012] MP Authoring: Targeting RMS or MS?
This posting is provided "AS IS" with no warranties.
Thursday, August 30, 2012
[OpsMgr 2012] Boris Yanushpolsky 's Tools updated for OpsMgr 2012 by Daniele Muscetta - New update
In order to not let those tools go to waste, since many people use them, Daniele Muscetta have asked Boris Yanushpolsky to give him the code of his tools and allow him to update and maintain those tools going forward.
Here is the last update from Daniele on August 29th 2012 : MPViewer 2.1.2 contains fixes to show Perf Objects, Counters and Frequency for some more modules.
Get lastest updates directly on : http://blogs.msdn.com/b/dmuscett/archive/2012/02/19/boris-s-tools-updated.aspx
The previous version 1.7 (that works with OpsMgr 2007 and 2007 R2) was released here. Version 2.1.2 has been updated to work with OpsMgr 2012, and now includes support for MPB files (MP Bundles) as well as the ability to Unseal and Unpack MP Bundles.
Warning: only MP Bundles that contain a single ManagementPack are supported; there are some Service Manager MPBs that contain multiple ManagementPacks in a single bundle, and this tool currently cannot deal correctly with those.
The previous version 3.3 (that works with OpsMgr 2007 and 2007 R2) was released here. Version 3.5 has been updated to work with OpsMgr2012 and includes some minor fixes, as well as the capability to Export all overrides to an Excel spreadsheet.
The previous version 1.1 (that works with OpsMgr 2007 and 2007 R2) was released here. Version 1.2 is functionally identical to the previous version but has been just recompiled to work with OpsMgr 2012 SDK.
All the above tools require the Operations Manager Console being installed on the machine where you run them, as well as the .NET framework 4.0.
According to my information, the above three tools were the most used/useful. Feel free to comment if need any other one being updated and/or have bug reports or feature requests – albeit I don’t promise I will be able to fix or update everything
Disclaimer
Just like their predecessors, it is necessary to make clear that this posting is provided "AS IS" with no warranties, and confers no rights.
Use of included utilities are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm
Changelog / Updates
[Updated on March 8th 2012 with MPViewer 1.9.1 that contains a fix for the Excel export of some MPs]
[Updated on March 15th 2012 with MPViewer 2.0 that now allows you to Unseal/Unpack MPs and MPBundles]
[Updated on March 21st 2012 with OverrideExplorer 3.5 which now allows to export Overrides to Excel]
[Updated on July 19th 2012 with MPViewer 2.1 that now shows the PublicKeyToken for referernces/dependencies]
[Updated on August 29th 2012 with MPViewer 2.1.2 that contains fixes to show Perf Objects, Counters and Frequency for some more modules]
Sources : http://blogs.msdn.com/b/dmuscett/archive/2012/02/19/boris-s-tools-updated.aspx
This posting is provided "AS IS" with no warranties.
Friday, June 29, 2012
[OpsMgr 2012] Wait is over ! We can now download the new SCOM authoring tools
What a good new ! I'll test them as soos as possible !
| Version: | 1.0 CTP1 | Date published: | 6/28/2012 |
| File name | Size | |
|---|---|---|
| MPDesigner.Installer_x64.msi | 4.6 MB | Download |
| MPDesigner.Installer_x86.msi | 4.6 MB | Download |
Overview
The System Center 2012 Visio MP Designer—VMPD—is an add-in for Visio 2010 Premium that allows you to visually design a System Center Operations Manager Core Monitoring Management Pack. VMPD generates a Management Pack that is compliant to the MP Authoring Best Practices by simply dragging and dropping Visio shapes to describe your application architecture and configuring them through the Shape Properties.
Feature Summary
- Visually describe your application architecture which generates classes and discoveries.
- Visually add monitoring to create monitors and rules.
- Start quickly from our pre-canned single server and multi-server patterns.
System requirements
Supported operating systems: Windows 7, Windows 8 Release Preview, Windows Vista- Other Software: Microsoft Visio Premium 2010
Instructions
- Download the MSI that corresponds to the version of Microsoft Office you have. (Most customers have the 32-bit version of Office.
- Ensure Microsoft Visio Premium 2010 is not running.
- Execute the MSI to install.
- Open Microsoft Visio Premium 2010. Click File --New -- then the Software and Database category -- then System Center Operations Manager Core Monitoring Management Pack.
The System Center 2012 Visual Studio Authoring Extensions—VSAE—is an add-in for Visual Studio 2010 Professional provides Lifecycle Management Tools to support Management Pack Authoring.
| Version: | 1.0 | Date published: | 6/28/2012 |
| File name | Size | |
|---|---|---|
| VisualStudioAuthoringConsole.msi | 20.5 MB | Download |
Overview
The System Center 2012 Visual Studio Authoring Extensions—VSAE—is an add-in for Visual Studio 2010 Professional provides Lifecycle Management Tools to support Management Pack Authoring.
Feature Summary
- VS Projects for Monitoring MPs, System Center 2012 MPs including Operations Manager and Service Manager.
- MP Item Templates for quick creation of MP Items.
- XML MP Item Templates (generates MP XML for editing).
- Template Group Item Templates (Abstract your intent from MP XML).
- Snippet Templates (generates MP XML from CSV)
- IntelliSense for MP XML for the following versions:
- System Center Operations Manager 2007 R2
- System Center 2012 Operations Manager
- System Center 2012 Service Manager
- Integrates into Visual Studio Project System with *.mpproj.
- Enables building within VS & MSBuild.
- Supports custom build tasks (simply edit *.mpproj or *.sln)
- Build multiple MPs (multiple *.mpproj) in a solution.
- Integrates into any VS supported Source Control systems.
- MP Navigation Features
- Management Pack Browser for browsing MP Items.
- Go to Definition
- Find All References
- ResKit Tools integrated
- Workflow Simulator
- Generate Visio Diagram
- MP Best Practice Analyzer
- MP Spell Checker
- MP Cookdown Analyzer
System requirements
Supported operating systems: Windows 7, Windows 8 Release Preview, Windows Vista- Other Software: Microsoft Visual Studio 2010 Professional or higher
Instructions
- Download the MSI.
- Ensure Microsoft Visual Studio 2010 Professional is not running.
- Execute the MSI to install.
- Open Microsoft Visual Studio 2010 Professional. Click File - New - Project - Management Pack.
This posting is provided "AS IS" with no warranties.
Monday, June 18, 2012
[OpsMgr 2012] 10 reasons NOT to use the Visual Studio Authoring Extensions VSAE
Also here are the 10 reasons to use the VSAE tool for MP authoring :
- SourceSafe integration
- MP object viewer
- Find references
- Simulating your workflows
- Jump to referenced MP objects.
- Intellisense
- Build and deploy
- Management objects templates
- Convert your ‘old’ OM07 MPs
- It just a must have.
Read more on the original post.
This posting is provided "AS IS" with no warranties.
Wednesday, May 16, 2012
[OpsMgr 2007R2] Where is my created group gone - Cannot retrieve my group to apply overrides
Suppose a group is created in a non-sealed MP. A discovery is created in a other unsealed MP with the enable state by default to false. You want to override the discovery for the group created in the first non-sealed MP.
SCOM interface doesn't show you all the groups and you cannot retrieve your group !
The reason is an unsealed MP cannot be referenced by any other MP
3 ways to solve this issue :
- Create the group in the same MP that contains the rule/monitor or discovery to override
- Seal the MP that contains the rule/monitor or discovery - Overrides will be stored in the non-sealed MP that contains the group. Reference to the sealed MP will be created in the non-sealed MP.
- Seal the MP that contains the group - Overrides will be stored in the non-sealed MP that contains the overrided rule/monitor or discovery. One limitation will be that the group will only accept new members only if it's a dynamic populated group.Reference to the sealed MP will be created in the non-sealed MP.
This posting is provided "AS IS" with no warranties.
Thursday, April 26, 2012
[OpsMgr 2007] How to create a group of all Windows Computers that are NOT a member of another group
Once again, thanks to Kevin ! :)
This posting is provided "AS IS" with no warranties.
Wednesday, April 18, 2012
[OpsMgr 2007] How to create a group of objects that are contained by an other group
I've work on the MP he has provided is his post and added 3 groups to answer this interesting customer request.
The request was to be able to make an override on the monitor "Percentage of Committed Memory in Use" in the OS MP for all SQL servers. Not so easy to do it since you retrieve at least 3 monitors "Percentage of Committed Memory in Use" - one in each Windows Server xxxx Operating System class. We have also to build 3 groups, one per OS version.
And to be really clean, I have to create 3 dynamic groups that contains Operating System.objects - one by OS version. Dynamic groups because customer asked the override to be created for all SQL servers monitored.
- One group of Operating System = 2008 and server is SQL server
- One group of Operating System = 2003 and server is SQL server
- One group of Operating System = 2000 and server is SQL server
The way to proceed will be the same as the one explained by Kevin. I've also add some other references to the Microsoft Windows Server xxxx MPs :
Then you are able to create 3 classes OS2000GroupSQL, OS2003GroupSQL and OS2008GroupSQL and the 3 associated discoveries:
- Populate OS Group – SQL – 2008 Server
- Populate OS Group – SQL – 2003 Server
- Populate OS Group – SQL – 2000 Server
Then select the Configuration tab, Browse for a Type and select Microsoft.SystemCenter.GroupPopulator. Give a module ID - then you may have an error that must be ignored.
On the configuration screen – select “Edit”
We will be replacing the XML showing in Notepad with an example I have written. Highlight all but the first line and delete it.
Then paste this for the 2008 discovery :
<RuleId>$MPElement$</RuleId>
<GroupInstanceId>$MPElement[Name="Custom.Group.Example.OS2008GroupSQL"]$</GroupInstanceId>
<MembershipRules>
<MembershipRule>
<MonitoringClass>$MPElement[Name="Server2008!Microsoft.Windows.Server.2008.OperatingSystem"]$</MonitoringClass>
<RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
<Expression>
<And>
<Expression>
<RegExExpression>
<ValueExpression>
<Property>$MPElement[Name="Windows!Microsoft.Windows.OperatingSystem"]/OSVersionDisplayName$</Property>
</ValueExpression>
<Operator>ContainsSubstring</Operator>
<Pattern>2008</Pattern>
</RegExExpression>
</Expression>
<Expression>
<Contained>
<MonitoringClass>$MPElement[Name="Windows!Microsoft.Windows.Computer"]$</MonitoringClass>
<Expression>
<Contained>
<MonitoringClass>$MPElement[Name="MicrosoftSQLServerLibrary!Microsoft.SQLServer.ComputerGroup"]$</MonitoringClass>
</Contained>
</Expression>
</Contained>
</Expression>
</And>
</Expression>
</MembershipRule>
</MembershipRules>
</Configuration>
Save the discovery, save your MP and import it in your DEV environment ! :)
You will be able to retrieve your new group in the authoring part :
Note I've keep the group created by Kevin.
Just right click on it and select “View Group Members” - the group OS Group - SQL - 2008 Server should be populated with OS 2008 objects corresponding to SQL server installed in Windows server 2008 or 2008 R2 and all other version.
This posting is provided "AS IS" with no warranties.
Thursday, March 1, 2012
[OpsMgr 2007] Best practices to use for creating and configuring overrides
Store overrides in a separate management pack
For each management pack that you use in System Center Operations Manager 2007, create an additional management pack in which to store overrides. For example, after you import the Active Directory management pack, create an Active Directory Override management pack. Then, store any overrides that you configure for the Active Directory management pack objects in the Active Directory Override management pack.Do not use the Disable command in the Overrides menu to create an override to disable monitors, rules, or object discoveries
When you want to disable a management pack object, do not use the Disable the ObjectName command on the Overrides menu. Instead, click the Override option to override the object. Then, follow these steps:- In the Override Properties dialog box, click to select the Override check box that corresponds to the Enabled parameter.
- In the Override Setting column, click False.
- In the Select destination management pack list, click the appropriate management pack in which to store the override.
Make sure that an overridden parameter is set for every rule and for every monitor that uses the parameter
When you override a parameter, make sure that the parameter is configured for each rule that uses the parameter and for each monitor that uses the parameter. There may be more than one rule or monitor that uses the particular parameter.For example, the following rules and monitors use the Intersite Expected Max Latency parameter:
Monitors
- AD Replication Monitoring
- AD Replication Performance Collection - Metric Replication Latency
- AD Replication Performance Collection - Metric Replication Latency: Maximum
- AD Replication Performance Collection - Metric Replication Latency: Minimum
- AD Replication Performance Collection - Metric Replication Latency: Average
Configure overrides for groups instead of for specific instances
We recommend that you configure an override for a group instead of using an override to target a specific instance. Configuring overrides for groups allows for better manageability than what is available if you target a specific instance. To configure an override for a group, follow these steps:- Create a group that has the following characteristics:
- Create the group in the appropriate overrides management pack.
- Configure the group to contain the particular instances or formulas that target the instances that you want to override.
- Click the For a group command on the submenu of the Overrides menu.
- In the Select Object dialog box that appears, click the new group that you created.
Test overrides by using an override management pack and groups in a test environment
You can test overrides in one environment and then apply the overrides to another environment. For example, you can test an override in a test environment and then implement the override in a production environment. To do this, follow these steps:- Create the test groups in the appropriate override management pack.
- Add the appropriate instances from the test environment to the test groups. You can explicitly specify the instances. Or, you can use a formula to specify the instances.
- Perform sufficient testing to validate the override.
- Export the particular management pack from the test environment.
- Import the override management pack into the production environment.
- Populate the groups that are contained in the override management pack by using the appropriate instances from the production environment.
See http://support.microsoft.com/kb/943239 published on December 2007.
This posting is provided "AS IS" with no warranties.
Thursday, February 23, 2012
[OpsMgr 2012] Boris Yanushpolsky 's Tools updated for OpsMgr 2012 by Daniele Muscetta
In order to not let those tools go to waste, since many people use them, Daniele Muscetta have asked Boris Yanushpolsky to give him the code of his tools and allow him to update and maintain those tools going forward.
Here is the result of Danielle's Job - the 3 tools bellow are now working with OpsMgr 2012:
Get Latest updates directly on http://blogs.msdn.com/b/dmuscett/archive/2012/02/19/boris-s-tools-updated.aspx
- MPViewer : The previous version 1.7 (that works with OpsMgr 2007 and 2007 R2) was released here. Version 1.9 has been updated to work with OpsMgr 2012, and now includes (limited) support for MPB files (MP Bundles)
- OverrideExplorer : The previous version 3.3 (that works with OpsMgr 2007 and 2007 R2) was released here. Version 3.4 has been updated to work with OpsMgr2012 and includes some additional, minor, fixes.
- Proxy Settings : The previous version 1.1 (that works with OpsMgr 2007 and 2007 R2) was released here. Version 1.2 is functionally identical to the previous version but has been just recompiled to work with OpsMgr 2012 SDK.
Requirement : Operation Manager console + .NET framework 4.0 must be installed on the machine you use to run the tools
Don't hesitate to comment or report bugs to Daniele Muscetta - He will try to fix and update everything.
Remark : Just like their predecessors, it is necessary to make clear that this posting is provided "AS IS" with no warranties, and confers no rights. Use of included utilities are subject to the terms specified at http://www.microsoft.com/info/copyright.htm
This posting is provided "AS IS" with no warranties.
Thursday, February 16, 2012
[Authoring MP] MPBPA analysis tool always report "Alerts should have name and description defined"
- when you open a rule, switch to configuration and check what is missing in the alert section.
- If it's not there, check display name and description for the alert.
A best practice should be to have a base MP contains only the ENU strings.
This posting is provided "AS IS" with no warranties.
Tuesday, January 31, 2012
[SCOM 2007 R2] Authoring Console ask for Microsoft.SystemCenter.Library version 6.1.7221.61 for editing a MP
KB only applicable to if CU4 or later is installed.
You are prompted for the latest version of the Microsoft.SystemCenter.Library management pack when you try to edit a new management pack in the Authoring Console in Microsoft System Center Operations Manager 2007 R2 after you install Cumulative Update 4 (CU4) or later versions.
Root cause : This issue occurs because new management packs that are imported or created automatically in Operations Manager 2007 R2 after you install Cumulative Update 4 or later versions have a dependency on the latest version of the Microsoft.SystemCenter.Library management pack (The latest version of the Microsoft.SystemCenter.Library management pack may be version 6.1.7221.61 or a later version).
Resolution :To resolve this issue, download the latest version of the Microsoft.SystemCenter.Library management pack from the Microsoft Download Center, then extract the management pack and copy it to the following folder:%ProgramFiles%\System Center MP Authoring Console 2007
The next time that you use the Authoring Console to edit a new management pack, you will not be prompted for the Microsoft.SystemCenter.Library management pack.
For more information please read the microsoft web page http://support.microsoft.com/kb/2590414
This posting is provided "AS IS" with no warranties.
Thursday, December 1, 2011
[SCOM 2007] Authoring Management Pack - Create a VBS discovery with a debugging functionnality - PART II
- First part of the discovery script is to declare and set the variable
- Option Explicit
- SetLocale("en-us")
- '-----------------------------------------------------------------------------------------------------
- ' DEFAULT VARIABLES AND CONST - Used by the debuging functions and sub
- '-----------------------------------------------------------------------------------------------------
- Const REGKEYPATH = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Operations Manager\Debugging"
- Const REGISTRYDEFVALUE = "FALSE"
- Const MOMEVENTLOGERROR = "1"
- Const MOMEVENTLOGWARNING = "2"
- Const MOMEVENTLOGINFORMATION = "4"
- Dim intIndex
- Dim strRegValue
- Dim strRegKeyName
- Dim strMPScriptName
- Dim strCurrentDebugModeValue
- Dim oAPI
- Dim oInst
- Dim oArgs
- Dim oDiscoveryData
- '-----------------------------------------------------------------------------------------------------
- ' SET THE FOLLOWING VALUES ACCORDING TO YOUR MANAGEMENT PACK
- '----------------------------------------------------------------------------------------------------
- strMPScriptName = "MyNewMP.DSC1.vbs"
- strRegKeyName = "Verbose.MyNewMP"
- '-----------------------------------------------------------------------------------------------------
- ' Create the object that connect to MOM API
- Set oAPI = CreateObject("MOM.ScriptAPI")
- '-----------------------------------------------------------------------------------------------------
- ' DEFAULT FUNCTIONS - Used for Management Pack debugging
- '-----------------------------------------------------------------------------------------------------
- Private Function fct_ReadRegistryKey(ByVal strKeyPath, ByVal strKeyName)
- 'Read Registry key located on KeyPath\KeyName
- 'Returns the value of a registry key and eventually a no-value to identify that the key does not exists.
- Dim oWshShell
- Dim strRegReadValue 'Contains the value of the Registry Key
- 'Try to read the registry key located to strKeyPath\strKeyName
- On Error Resume Next
- Set oWshShell = CreateObject("Wscript.Shell")
- strRegReadValue = oWshShell.RegRead(strKeyPath &"\" & strKeyName)
- 'If an error is raised Then we a no-value to identify that the Registry Key does not exist.
- If err.number <> 0 Then
- strRegReadValue = ""
- End if
- On error goto 0
- fct_ReadRegistryKey = UCase(strRegReadValue)
- End Function
- '-----------------------------------------------------------------------------------------------------
- Private Function fct_WriteRegistryKey(ByVal strKeyPath, ByVal strKeyName, ByVal strKeyValue)
- ' Write a Registry value to strKeyPath\strKeyName with value strKeyValue
- ' blnKeyEdit is set to True or false in case of error.
- Dim blnKeyEdit
- Dim oWshShell
- blnKeyEdit = false
- 'Try to set strKeyValue to the registry key strKeyPath\strKeyName
- On Error Resume Next
- Set oWshShell = WScript.CreateObject("WScript.Shell")
- oWshShell.RegWrite strKeyPath & "\" & strKeyName , UCase(strKeyValue)
- 'If setting the registry key strKeyValue is OK Then the function will return a string TRUE.
- If err.number = 0 Then
- blnKeyEdit = true
- End if
- On error goto 0
- fct_WriteRegistryKey = blnKeyEdit
- End Function
- '-----------------------------------------------------------------------------------------------------
- Private Sub sub_LogMPScriptEvent(ByVal intErrNumber, ByVal strEventLogMessage, ByRef objError, ByVal strDebugMod, ByVal strScriptName, ByVal strMomEventLevel)
- ' Log an event in the OperationManager eventLog of the server if it is in debug mode
- ' It will allow to trace the debugging process of the script of the Management Pack by logging errors and parameters values
- Dim strMessage
- strMessage=""
- 'If the debug mode is ON, an event is logged in the Operation Manager eventLog.
- If ucase(strDebugMod) = "TRUE" Then
- strMessage = strEventLogMessage & vbCrLf & " " & vbCrLf & _
- "Error number:" & vbTab & CStr(objError.Number) & vbCrLf & _
- "Error description:" & vbTab & objError.Description
- Call oAPI.LogScriptEvent(strScriptName, intErrNumber, strMomEventLevel, strMessage)
- End if
- End Sub
- '-----------------------------------------------------------------------------------------------------
- Private function fct_LogRunningAccount(ByVal strDebugMode)
- ' Log an event in the OperationManager eventLog of the server if it is in debug mode
- ' It allows to know under which credentials the script is executed
- Dim owshNetwork
- Dim strRunningUserID
- On Error Resume Next
- Set owshNetwork = WScript.CreateObject("WScript.Network")
- 'Assign user name returned to a variable
- strRunningUserID = owshNetwork.UserName
- call sub_LogMPScriptEvent (4005, "sub_LogMPScriptEvent. Script running as user: " & strRunningUserID , Err, strDebugMode,strMPScriptName,MOMEVENTLOGINFORMATION)
- On error goto 0
- fct_LogRunningAccount = strRunningUserID
- End Function
- '-----------------------------------------------------------------------------------------------------
- private sub sub_LogScriptStartInfo(byRef oArgs, byVal strDebugModeValue, byval strMomLevelEvent, byVal strScriptName)
- ' Log an event with the default informations. The event contains :
- ' - The account used to run the script
- ' - The number of script parameters
- ' - The values of the parameters
- ' - The value of the debug mode
- Dim owshNetwork
- Dim strLogMessage
- Dim strRunAsAccount
- On Error Resume Next
- Set owshNetwork = WScript.CreateObject("WScript.Network")
- 'Assign user name returned to a variable
- strRunAsAccount = owshNetwork.UserName
- strLogMessage=""
- ' Create the start log Script with launch information data RunAs account, debugmode, arguments)
- strLogMessage = vbcrlf & "The script has been launched under following credentials : " & strRunAsAccount & "." & vbcrlf & vbcrlf & oArgs.count & " arguments have been passed in parameter : "
- For intIndex = 0 To oArgs.Count-1
- strLogMessage = strLogMessage & vbcrlf & " - " & oArgs(intIndex)
- Next
- strLogMessage = strLogMessage & vbcrlf & vbcrlf & "The debug mode value for the Management Pack is set to : " & strDebugModeValue
- Call oAPI.LogScriptEvent(strScriptName, 10212, strMomLevelEvent, strLogMessage)
- End sub
- '-----------------------------------------------------------------------------------------------------
- '-----------------------------------------------------------------------------------------------------
- ' MAIN CODE START HERE
- '-----------------------------------------------------------------------------------------------------
- ' Gets the arguments passed in parameters of the script
- Set oArgs = Wscript.Arguments
- ' If the minimals arguments are not set then we exit the script
- if oArgs.Count < 3 Then
- Wscript.Quit -1
- End If
- ' Check the value of the registry key on the server to know if the debug mode is ON or not
- 'By default the registry key is set to : DOES NOT EXIST. See fct_ReadRegistryKey for more information
- strRegValue = fct_ReadRegistryKey(REGKEYPATH, strRegKeyName)
- 'If the registry key is TRUE XOR FALSE then the debugmodevalue has a good value
- If ((strRegValue = "TRUE") Xor (strRegValue = "FALSE")) Then
- strCurrentDebugModeValue = strRegValue
- Else
- 'If the registry key is empty or not correctly set then a attempt to set to default value is made.
- If fct_WriteRegistryKey(REGKEYPATH, strRegKeyName, REGISTRYDEFVALUE) Then
- ' write event 10211 that says the registry key has been created
- call sub_LogMPScriptEvent (10211, "Registry Key " & REGKEYPATH & "\" & strRegKeyName & " With Value = " & REGISTRYDEFVALUE & " has been created", Err, True,strMPScriptName,MOMEVENTLOGINFORMATION)
- Else
- ' write event 10210 that says the registry key has not been created
- call sub_LogMPScriptEvent (10210, "Error in creation of the Registry Key " & REGKEYPATH & "\" & strRegKeyName & " With Value = " & REGISTRYDEFVALUE , Err, True,strMPScriptName,MOMEVENTLOGERROR)
- End if
- strCurrentDebugModeValue = REGISTRYDEFVALUE
- End if The discovery itself : 'Return Data to the Management PackCall oDiscoveryData.AddInstance(oInst)
- Dim intSourceType
- Dim strSourceId0
- Dim strTargetComputer
- Dim strManagedEntityId
- intSourceType =
- 'Set the arguments for creating the default Management Pack modules.strSourceId = oArgs(0)
- strManagedEntityId = oArgs(1)
- strTargetComputer = oArgs(2)
- 'Create the default management pack classSet oDiscoveryData = oAPI.CreateDiscoveryData(intSourceType, strSourceId, strManagedEntityId)
- Set oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='MyNewMP.CLS1']$")
- call oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", strTargetComputer)
- call oInst.AddProperty("$MPElement[Name='System!System.Entity']/DisplayName$", "MyNewMP")
- call oInst.AddProperty("$MPElement[Name='MyNewMP.CLS1']/DebugMod$", strCurrentDebugModeValue)
- call sub_LogMPScriptEvent (10213, "Server "& strTargetComputer & " has been discovered. The debug mode value on this server is set to " & strCurrentDebugModeValue, Err, strCurrentDebugModeValue,strMPScriptName,MOMEVENTLOGINFORMATION)
- '-----------------------------------------------------------------------------------------------------
- ' PUT YOUR DISCOVERY CODE AFTER
- '-----------------------------------------------------------------------------------------------------
- 'Return Data to the Management PackCall oDiscoveryData.AddInstance(oInst)
- Call oAPI.Return(oDiscoveryData)
This posting is provided "AS IS" with no warranties.










