Friday, September 24, 2010

Ops Mgr Command Line Switches

If you ever wanted to start Ops Mgr from the command line, or force it into certain views when it comes up, here's the ticket:


That plays out as:

Microsoft.MOM.UI.Console.exe {/option[:value]}

/? - show this help window
/ClearCache - clear the UI cache
/Server: - connect to the specified server
/Viewname: - display a view
/Taskname: - run a task
/TaskTarget: - use in conjunction with /task
/ManagementPack: - use in conjunction with /taskname and /viewnane options

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>

Tuesday, September 21, 2010

VBScript: Start a Windows Explorer to a specific directory

WshShell.Run "explorer.exe /e," & Directory

VBScript: Filesystem stuff

Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.FolderExists(ORIGINAL) then
Const FOF_CREATEPROGRESSDLG = &H0&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.NameSpace(TARGET)
objFolder.MoveHere ORIGINAL, FOF_CREATEPROGRESSDLG
If objFSO.FolderExists(ORIGINAL) then
objFolder.MoveHere ORIGINAL, FOF_CREATEPROGRESSDLG
end if

Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")

if FSO.FileExists(ORIGINAL & "\config\Discovery.xml") then
FSO.CopyFile ORIGINAL & "\config\Discovery.xml", InstallLocation & "\config\"
End If
end if

VBScript: Getting User's Home Directory

Set colProcessEnvVars = WshShell.Environment("Process")
HomeDir = colProcessEnvVars("HOMEDRIVE") & colProcessEnvVars("HOMEPATH")

VBScript: Check the bit-ness of the OS

Set WshShell = WScript.CreateObject("WScript.Shell")
Set colProcessEnvVars = WshShell.Environment("Process")
processorArchitecture = colProcessEnvVars("PROCESSOR_ARCHITECTURE")
if processorArchitecture = "AMD64" then
WshShell.Echo "64-bit"
else
WshShell.Echo "32-bit"
end if

VBScript: Checking to see if a process is currently running

strComputer = "."

Set objWMIService = GetObject("winmgmts:" &_
"{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\cimv2")

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")
For Each objProcess In colProcess
if left(objProcess.Name,11) = "Process.exe" then
msgbox "Process is currently running.", 48, "Process is Running"
wscript.quit
end if
Next

Loading up some VBScript for future reference...

My next few posts are just samples of VBScript that I built for work that I want to be able to reference in the future.

As you were.

Tuesday, September 14, 2010

Sunday, August 8, 2010

Learn something every day...

I'm a firm believer in ongoing learning and personally, I prefer to learn about as diverse a set of topics as possible. However, today I learned something that was relatively simple -- and expensive to learn.

We are fortunate to have a beach house that we use on occasion and sometimes share with friends. In Emerald Isle, NC (where the beach house is located), there is no city sewer, so every home has its own septic tank. Growing up on the farm in a farmhouse built in the 1920s, I was familiar with the role of a septic tank and even where ours was, but the finer details were lost on me.

Even had I been paying close attention then, it wouldn't have mattered. I found myself a couple of weeks ago with a toilet that just wouldn't flush...but after a while, it would flush once. I dreaded it being a costly plumbing and/or septic issue, but kept trying homeowner remedies.

Now I'm here at the beach house with family in town and the toilet is acting up again -- this time causing "gurgling" in all the drains in the downstairs. So I went to Lowe's and bought a cheap closet auger to snake the toilet (assuming/hoping that was the problem). Toilet snaked and flushed successfully! Once...but the second time failed.

So I researched this problem on the Internet and came away with three theories -- partial blockage in the drain line from the toilet, partial blockages in the main drain line to the septic tank, or that the septic tank was full and needed to be pumped. I called a local plumber with my theories and he came to take a look.

Before he even knocked on the door, he checked the septic tank. When he knocked and I answered, he said "I think I know what your problem is...Is this a new system?". I confirmed it was (1.5 years) and he asked if I'd checked the filter.

The filter?!?!?!? WTF?!?!?! Who knew there were filters in septic tanks????

According to Randy at Island Plumbing, septic tank manufacturers began adding greywater filters about 3 years ago and they need to be checked every 6-9 months. They sit in the t-connector that allows greywater to bubble up and drain to the distribution box, where it gets sent to the leach field. They are nothing more than a long thin plastic basket with a rubber gasket at the bottom to keep stuff from floating around it and, in fact, ours was all plugged up. He pulled it out, hosed it off, put it back and all is well.

So you learn something new every day. And if you learn it on Sundays, it's double time.

Tuesday, July 27, 2010

A good guy to know...

Finally made some time to connect with a friend/colleague whom I get to see regularly (at BlueStripe Software BoD meetings) but rarely get to talk at length with. Justyn Kasierski is not only a good guy, he's got an interesting start-up in-flight and is overall one of the best connected guys in the start-up game in RTP.

Despite being in the start-up game locally for the past 12 years (minus 3 at Cisco, but I digress...), I don't have relationships with many of the key local players. Justyn's helping me fix that.

Monday, July 26, 2010

Building beautiful software...

So the process of creating great software products has always intrigued me. There's no singular "right" answer, as it varies upon your company, your team's skills, your culture, etc.

I just recently discovered Tyner Blain and have to say I'm impressed. This guy's a thinker...

Sunday, July 4, 2010

Fixing a flat

I have a small beach cart I use for hauling stuff to/from the beach, usually beach chairs and such, but sometimes fishing gear. The cart was originally sold as a fishing cart and is built to carry more weight than the typical cart, thus the pneumatic tires.

Unfortunately, a tire went flat and got rolled around a bit, causing the tire to become unseated. After much time of messing with it, I turned to the web for help in getting the tire seated.

Ultimately, I stumbled upon this link at eHow: http://www.ehow.com/how_6648168_homemade-tire-bead-seating-tool.html, which worked swimmingly (and a little to my surprise).

However, I was saddened that I didn't have any lighter/starter fluid because this one appealed to me (greatly): http://www.youtube.com/watch?v=H-9AxvoXFZ0&feature=related

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.

Saturday, June 12, 2010

Emerald Isle / Bogue Banks Golf Courses

Today, with some friends, played the course at Country Club of the Crystal Coast. It's by far my favorite course in the Emerald Isle area...check it out if you're in the area:



Thursday, June 10, 2010

Powershell: Bringing Sexy Back

Stumbled across this neat little "Intro to Powershell" page and wanted to archive it for my (and now your) future reading pleasure...



Nifty editor

I've been writing code recently and doing a lot of on-the-fly debugging, so manipulating both log files (output) and structured input files for testing. All have different formats so I'd been using an IDE and two bash windows to accommodate my needs.

Until a co-worker turned me on to Notepad++ (yes, I'm developing on Windows). This is a slick little download from SourceForge (Free as in Beer and Speech) and does just about everything I've ever wanted an editor to do but either a) it couldn't or b) I couldn't remember how to make vi do it.

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

And just like that, Bing becomes irrelevant

Got a note from Bing today saying that they are discontinuing their cash back program...

Dear valued cashback customer:

We are writing to notify you that the Bing cashback program will be discontinued, and the last day to earn cash back on your Bing Shopping purchases will be July 30, 2010.

Until July 30, 2010 9:00 pm PST, it's business as usual so continue to take advantage of great offers from your favorite merchants. You can redeem all of your earned cashback savings consistent with the cashback terms and conditions and access the Bing cashback customer support system through July 30, 2011. We encourage you to redeem your cashback savings and to further support redemption, we are waiving the $5 minimum payout effective July 31, 2010. To assist with prompt delivery of your cashback earnings, please visit http://cashbackaccount.bing.com to ensure your account information is current. For more details and answers to your questions, please visit our frequently asked questions page.

Thank you very much for being a loyal cashback user. We remain committed to delivering great value to our customers, and we are currently working on an exciting new program which you will hear more about from us later this summer.

Sincerely,

Bing cashback team


And just like that, I'm back to being an exclusive Google user.

Sunday, June 6, 2010

Drum Stick Sizes

I've recently started playing drums again after a roughly 20-year hiatus. It's fun, but the percussion industry has come a long way in the past two decades.

When I last played, I owned a Ludwig Octo-Plus kit (double bass, 8 mounted concert toms) and played with Pro-Mark 747 sticks with nylon tips. When getting back into it, I bought a new set of 747s, but then decided to look around a little bit and try out some others.

I started off by checking out the technical specs of the 747s and seeing what was close. Since most sticks are hickory, I decided not to try varying that part of the equation.

Pro-Mark lists their 747s as:
  • Length: 16.25"
  • Diameter: .551"
Then came the deluge of details...

Most drummers know that there are a few common sizes and uses:
  • 7A - a thin, light stick. Generally used for jazz in small combo settings
  • 5A - a medium stick. This is probably the most common size.
  • 5B and 2B - thicker, heavier sticks. These are most typically used in heavy rock situations, to get a heavier sound, as well as to prevent breakage.
All manufacturers offer a WIDE variety of size options. Below, I compare some of the common ones across their lines. Note: With the advent of stick endorsement deals, every vendor also has their "signature" sticks which are made to the specifications of the endorser. The complexity continues ad nauseam...

Pro-Mark lists key sizes (Size/Diameter in Inches/Length in Inches):
  • 7A - .512" - 15.375"
  • 727 - .531" - 16"
  • 5A - .551" - 16"
  • 747 - .551" - 16.25"
  • 5B - .590" - 16"
  • 2B - .630" - 16"
Vic Firth lists their sizes a bit differently:
  • 7A - .540" - 15.5"
  • 5A - .565" - 16"
  • 5B - .595 - 16"
  • 2B - .630" - 16.25"
  • Rock - .630" - 16.625"
  • 7A - .540" - 15.5"
  • Pro Rock - .555" - 16.25"
  • Los Angeles 5A - .570" - 16"
  • Fusion - .580" - 16"
  • 5B - .605" - 16"
  • Rock - .630" - 16.625"
  • 2B - .635" - 16.25"
Regal is different, too:
  • 7A - .510" - 15"
  • Rock - .555" - 16.25"
  • 5A - .580" - 16"
  • 5B - .600" - 16"
  • 2B - .655 - 16"
Zildjian weighs in as well:
  • 7A - .525 - 15.5"
  • Jazz - .540" - 16"
  • 5A - .560" - 16"
  • 5B - .600" - 16"
  • 2B - .625" - 16"
  • Rock - .625" - 16.625"
I stumbled across a deal to buy some Vater-manufactured "Sam Ash Specials" (5 pair for $10), so I decided I'd give it a try. They are 5As and I think I'm a convert. The other notable change for me is that I'd historically only played nylon tip sticks and these "Specials" are wood tip. Well, I'm a convert on that front as well. I used to like the bright "ping" on the ride cymbal and hi-hat, especially when playing surf rock. Now that I'm playing more classic rock/southern rock, I don't need the brightness -- and in fact, don't want it.

So for now, I'm a cheap-stick fan, especially of the wood-tip 5As. But I prefer a smaller 5A...for what it's worth.

Saturday, June 5, 2010

Powershell, Versions, Modules & Snap-ins

I've been working on a Powershell script that will soon ship as part of a product. As such, it has requirements that it must meet, and I started development on the wrong end of that spectrum.


I mean, Powershell is Powershell, right? Well, yes. But Powershell v1.0 is not Powershell v2.0 and the differences are both subtle and important. Especially when it comes to using Modules (DLLs) and Snap-ins.


My first problem was that I started development on my Windows 7 64-bit laptop with Powershell 2.0. The first important takeaway from this experience:


1. Developing in Powershell 2.0 is better than Powershell 1.0.


And the second:


2. The Powershell ISE (Integrated Scripting Environment) may be the best tool I've used for developing scripts.


It's no Eclipse, but it's very handy and the price is right.


Anyway, the script I'm writing integrates with System Center Operations Manager 2007 (aka SCOM and OpsMgr). SCOM delivers an SDK that's available both on the management server and the console, so my script will be running in one of those two locations and relying on several different OpsMgr assemblies, including:

  • Microsoft.EnterpriseManagement.OperationsManager.dll
  • Microsoft.EnterpriseManagement.OperationsManager.Common.dll
  • Microsoft.EnterpriseManagement.OperationsManager.ClientShell.dll
and one system assembly:
  • System.Security
My troubles were heavily rooted in a combination of me not knowing Powershell, trying to cobble things together from snippets of code found on the web and in books, and starting off in the wrong version of Powershell running on the wrong "bitness" OS.


I needed to build this script so it would run in Powershell v1.0 and it needs to run on both 32-bit and 64-bit platforms. Finally, I got it working on v2.0 and 64-bit, but then started down a path of misery trying to make it backwards compatible. Along the way I learned a few things:

  • Modules/DLLs can get loaded in several ways.
  • Snap-ins need two key steps to work in your script -- they need to be registered with this system, which is the first step, then added to the script context you're working on.

Loading Modules/DLLs:

VERSION 2 ONLY: import-module "C:\Program Files\System Center Operations Manager 2007\Microsoft.EnterpriseManagement.OperationsManager.ClientShell.dll"
VERSION 1 & 2: [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.
EnterpriseManagement.OperationsManager")


Register your Snap-ins with the OS:

So this was an odd concept for me to finally get my head around. When you register your snap-in with the system, you're creating an entry in the system registry that describes the snap-in. This does NOT make the cmdlets available to your script. I didn't really grasp this until I understood the difference between Get-PSSnapins and Get-PSSnapins -Registered. More on this in a moment...


First, to get your Snap-in recognized by the system, you need to use the InstallUtil.exe utility. This is located in C:\Windows\Microsoft.NET\Framework\v2.0.50727\installutil.exe. Unfortunately, the actual path will vary with the bitness of your OS (Framework becomes Framework64 on 64-bit OSes) and with the version of .NET Framework embedded in the path, you will also have versioning of the framework to deal with.


In order to determine if your Snap-in registration was successful, you can either go check in the registry (A Registry key with SnapinName, which was defined in the PSSnapIn class, will be created under HKLM\Software\Microsoft\PowerShell\1\PowerShellSnapIns) or you can run Get-PSSnapins -Registered. Remember, this does NOT make the cmdlets available to your script...yet.


To make the cmdlets available to your script, you need to add them with Add-PSSnapins. At this point, the Get-PSSnapins command (no -Registered option) should tell you that your snap-in is loaded into the script context. And depending on the snap-in, you may need to source another script (.ps1) that includes the cmdlet function names, as was true in this case: &"C:\Program Files\System Center Operations Manager 2007\Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Functions.ps1"

I don't know if this is enough information or even presented clearly enough to help, but here's hoping. Also, you should check out the page that ultimately helped me decode this riddle (with thanks to Arul Kuramavel and the good people at Wrox): http://www.wrox.com/WileyCDA/Section/Extending-Windows-Powershell-with-Snap-ins.id-320555.html

Blog Post #1 -- FIRST POST!!!

So...this is blog post #1. I've tried blogging in the past, but never really had enough to say to keep it up. This time, it might be different.

Maybe...

Actually, I'm motivated this time by something other than sheer ego. This time, it's out of frustration that I've had to dig and dig and dig to find some technical information that should have been documented somewhere--PROMINENTLY. Instead, I had to scrap all the product docs and scour the web and, after over a week of looking, I found a post that got me headed in the right direction and finally figured out my problem. So I was thinking that a blog would be a handy place to capture this sort of information so the next idiot doesn't have to work so hard...

But more on that in a post with actual content.