Showing posts with label scom. Show all posts
Showing posts with label scom. Show all posts

Thursday, September 23, 2010

Ops Mgr's Application View Schema

It's not news to anyone trying to build Ops Mgr Management Packs that the Authoring Console does not expose all of the options supported and that often you have to edit the XML by hand.

That task gets much easier if you have/understand the schema you're working with. Here's one that I've been working with - the Application View xsd. Enjoy!

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeSpanCriteriaType">
<xsd:simpleContent>
<xsd:extension base="xsd:unsignedInt">
<xsd:attribute name="Unit" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Second"/>
<xsd:enumeration value="Minute"/>
<xsd:enumeration value="Hour"/>
<xsd:enumeration value="Day"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeRangeCriteriaType">
<xsd:choice>
<xsd:element name="WithinLast" type="TimeSpanCriteriaType"/>
<xsd:element name="Range">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="After" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="Before" type="xsd:dateTime" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DomainComputerCriteriaType">
<xsd:sequence>
<xsd:element name="Domain" type="xsd:string" minOccurs="0"/>
<xsd:element name="Computer" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SLECriteriaType">
<xsd:annotation>
<xsd:documentation>a single Service Level Exception criteria</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="Duration" type="TimeSpanCriteriaType"/>
<xsd:element name="ResolutionState" type="xsd:unsignedByte"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="GUIDCriteriaType">
<xsd:annotation>
<xsd:documentation>The representation of a GUID, generally the id of an element.</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:pattern value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DiagramViewPresentationCriteriaType">
<xsd:sequence>
<xsd:element name="DiagramViewDisplay" type="DiagramViewDisplayType" minOccurs="0"/>
<xsd:element name="DiagramMonitoringClass" type="DiagramMonitoringClassType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="DiagramMonitoringRelationshipClass" type="DiagramMonitoringRelationshipClassType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DiagramViewDisplayType">
<xsd:annotation>
<xsd:documentation>Diagram view display</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="BackgroundImageHotSpot" type="BackgroundImageHotSpotType" default="TopRight" minOccurs="0"/>
<xsd:element name="ContainmentStyle" type="ContainmentStyleType" default="NonBox" minOccurs="0"/>
<xsd:element name="LayoutDirection" type="LayoutDirectionType" default="NorthSouth" minOccurs="0"/>
<xsd:element name="NodesPerRow" type="xsd:int" default="2" minOccurs="0"/>
<xsd:element name="BoxBackgroundImageHotSpot" type="BackgroundImageHotSpotType" default="TopRight" minOccurs="0"/>
<xsd:element name="LevelsToShow" type="xsd:int" default="2" minOccurs="0"/>
<xsd:element name="ContainmentLine" type="LineType" minOccurs="0"/>
<xsd:element name="NonContainmentLine" type="LineType" minOccurs="0"/>
<xsd:element name="MaxNumChild" type="xsd:int" minOccurs="0" default="8"/>
<xsd:element name="MinBucketSize" type="xsd:int" minOccurs="0" default="5"/>
<xsd:element name="VirtualGroupThreshold" type="xsd:int" minOccurs="0" default="8"/>
</xsd:sequence>
<xsd:attribute name="ShowVirtualGroup" type="xsd:boolean" use="optional" default="true"/>
</xsd:complexType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DiagramMonitoringClassType">
<xsd:annotation>
<xsd:documentation>Diagram class</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="ID" type="xsd:string">
<xsd:annotation>
<xsd:documentation>ManagementPack.MonitoringClass decorated id</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="ContainmentStyle" type="ContainmentStyleType" default="NonBox" minOccurs="0"/>
<xsd:element name="LayoutDirection" type="LayoutDirectionType" default="NorthSouth" minOccurs="0"/>
<xsd:element name="NodesPerRow" type="xsd:int" default="3" minOccurs="0"/>
<xsd:element name="BoxBackgroundImageHotSpot" type="BackgroundImageHotSpotType" default="TopRight" minOccurs="0"/>
<xsd:element name="LevelsToShow" type="xsd:int" default="-1" minOccurs="0">
<xsd:annotation>
<xsd:documentation>-1 = Inherit from parent, 0 = Collapsed </xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="Layer" type="xsd:string" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Assigned layer</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="Tooltips" type="TooltipType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Tooltip properties</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="Annotations" type="AnnotationsType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Annotations</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="VirtualGroup" type="VirtualGroupType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Virtual group properties</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="IsExcluded" type="xsd:boolean" use="optional" default="false"/>
</xsd:complexType>
<xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ContainmentStyleType">
<xsd:annotation>
<xsd:documentation>Diagram style type</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Box"/>
<xsd:enumeration value="NonBox"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="LayoutDirectionType">
<xsd:annotation>
<xsd:documentation>Placement style type</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="NorthSouth"/>
<xsd:enumeration value="SouthNorth"/>
<xsd:enumeration value="WestEast"/>
<xsd:enumeration value="EastWest"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="BorderStyleType">
<xsd:annotation>
<xsd:documentation>Border style type</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Solid"/>
<xsd:enumeration value="Dot"/>
<xsd:enumeration value="Dash"/>
<xsd:enumeration value="DashDot"/>
<xsd:enumeration value="DashDotDot"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="BoxBorderWidthType">
<xsd:annotation>
<xsd:documentation>Border width type</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:double">
<xsd:pattern value="[1-5]"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ColorType">
<xsd:annotation>
<xsd:documentation>Box header color</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="Red" type="xsd:int" default="0"/>
<xsd:attribute name="Green" type="xsd:int" default="0"/>
<xsd:attribute name="Blue" type="xsd:int" default="0"/>
</xsd:complexType>
<xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="BackgroundImageHotSpotType">
<xsd:annotation>
<xsd:documentation>Box background image hotspot</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="None"/>
<xsd:enumeration value="Middle"/>
<xsd:enumeration value="TopRight"/>
<xsd:enumeration value="BottomRight"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TooltipType">
<xsd:annotation>
<xsd:documentation>Tooltips</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="Property" type="xsd:string" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="AnnotationsType">
<xsd:annotation>
<xsd:documentation>Annotations</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="Annotation" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Property" type="xsd:string"/>
<xsd:element name="Hotspot" type="AnnotationHotSpotType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="AnnotationHotSpotType">
<xsd:annotation>
<xsd:documentation>Annotation hot spot</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="FirstHotSpot"/>
<xsd:enumeration value="SecondHotSpot"/>
<xsd:enumeration value="ThirdHotSpot"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="VirtualGroupType">
<xsd:annotation>
<xsd:documentation>Virtual groups</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="VirtualGroupBy" type="VirtualGroupByType" default="ByType"/>
<xsd:element name="VirtualGroupHealthRollup" type="VirtualGroupHealthRollupType" default="WorstOf"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="VirtualGroupHealthRollupType">
<xsd:annotation>
<xsd:documentation>Virtual group health rollup</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="BestOf"/>
<xsd:enumeration value="WorstOf"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="VirtualGroupByType">
<xsd:annotation>
<xsd:documentation>Virtual group type</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="ByType"/>
<xsd:enumeration value="ByHealth"/>
<xsd:enumeration value="ByTypeAndHealth"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DiagramMonitoringRelationshipClassType">
<xsd:annotation>
<xsd:documentation>Diagram relationship class</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="ID" type="xsd:string"/>
<xsd:element name="Tooltips" type="TooltipType" minOccurs="0"/>
<xsd:element name="Line" type="LineType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="IsExcluded" type="xsd:boolean" use="optional" default="false"/>
</xsd:complexType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="LineType">
<xsd:annotation>
<xsd:documentation>Line type</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="Color" type="ColorType" minOccurs="0"/>
<xsd:element name="LineWidth" type="LineWidthType" default="1" minOccurs="0"/>
<xsd:element name="SourceArrow" type="ArrowType" minOccurs="0"/>
<xsd:element name="TargetArrow" type="ArrowType" minOccurs="0"/>
<xsd:element name="LineStyle" type="BorderStyleType" default="Solid" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="LineWidthType">
<xsd:annotation>
<xsd:documentation>Line width type</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:double">
<xsd:pattern value="[1-5]"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ArrowType">
<xsd:annotation>
<xsd:documentation>Arrow type</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="ArrowStyle" type="ArrowStyleType" default="Flat" minOccurs="0"/>
<xsd:element name="ArrowWidth" type="ArrowSizeType" default="5" minOccurs="0"/>
<xsd:element name="ArrowHeight" type="ArrowSizeType" default="5" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="IsFilled" type="xsd:boolean" default="true"/>
</xsd:complexType>
<xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ArrowStyleType">
<xsd:annotation>
<xsd:documentation>Arrow styles</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Flat"/>
<xsd:enumeration value="NoAnchor"/>
<xsd:enumeration value="AnchorMask"/>
<xsd:enumeration value="ArrowAnchor"/>
<xsd:enumeration value="DiamondAnchor"/>
<xsd:enumeration value="Round"/>
<xsd:enumeration value="RoundAnchor"/>
<xsd:enumeration value="Square"/>
<xsd:enumeration value="SquareAnchor"/>
<xsd:enumeration value="Triangle"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ArrowSizeType">
<xsd:annotation>
<xsd:documentation>Arrow size type type</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:int">
<xsd:pattern value="[1-9]"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ColumnInfoType">
<xsd:sequence>
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="Id" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="Index" type="xsd:integer" use="required"/>
<xsd:attribute name="SortIndex" type="xsd:integer" use="required"/>
<xsd:attribute name="Width" type="xsd:integer" use="required"/>
<xsd:attribute name="Grouped" type="xsd:boolean" use="required"/>
<xsd:attribute name="Sorted" type="xsd:boolean" use="required"/>
<xsd:attribute name="IsSortable" type="xsd:boolean" use="required"/>
<xsd:attribute name="Visible" type="xsd:boolean" use="required"/>
<xsd:attribute name="SortOrder" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:element name="Configuration">
<xsd:complexType>
<xsd:sequence>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Criteria" type="xsd:string" minOccurs="0"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Presentation" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="DiagramViewCriteria" type="DiagramViewPresentationCriteriaType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Target" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

Monday, June 28, 2010

SCOM is really starting to piss me off...

So, I've created a custom alert view in my Mgmt Pack. It relies on rules to determine what's populated in the view, and the rules apply to alerts that have been generated off of a custom Windows Event Log (which I've created).

Everything works fine...so long as you are on a machine where that Windows Event Log exists. If you are on another console, tough. The alerts will never load.

I thought it would be safe to assume that the rule I created earlier would comb the custom log (via the agent), populate alerts into the database, and then allow ALL consoles to view them. Silly me.

Monday, June 7, 2010

Displaying a Percent Sign (%) in a SCOM Event Description

I googled around a bit and discovered that the SCOM's "Description" field in the "Details" pane is actually rendered in HTML. Handy info, that, but it didn't help me get a percent sign rendered.

I ended up trying every contrivance you can imagine to try to make it happen -- all to no avail.

Ultimately, the magic that worked: "%%". Go figure.

Microsoft OpsMgr 2007 SDK Severity Levels

Documented here as much for my future reference as yours...

If you're using the SDK and are instantiating a CustomMonitoringEvent class, it comes with a LevelID property which holds an int. The value of that property determines the severity level the event is assigned, with the following mapping:
  • 1-Error
  • 2-Warning
  • 4-Information
  • 8-Success Audit
  • 16-Failure Audit
I found this via Google on the MSDN SDK web site, embedded in sample code. I didn't want to have to try to do that again.

Curious, see the original site here: http://msdn.microsoft.com/en-us/library/bb437567.aspx