Pavleck.Net

Monitoring, Scripting, and other Technologies

The newest OpsMgr MS MVP, workload, SDK, and miscellany.

Posted by Jeremy D. Pavleck on January 5th, 2009

Although I technically received the congratulations email several days ago, I debated about whether or not I should post it. But I might as well. Well, what is it already?

I am the newest MS MVP for OpsMgr! I am absolutely thrilled to be the 29th member of the OpsMgr MVP family, and really looking forward to seeing all the new found knowledge I’ll have access too, and can pass it on to you!

microsoft_mvp_logo

As for my workload, well I’m quite busy at the moment, so posts may be a tad sparse. There’s an MS engineer on site at this client, essentially to backup that yes, these are really the only ways to do this. I’m trying to bang out this SDK connector service, which essentially is the culmination of other posts I’ve written regarding the fine tuning of alerts via alert name. Some of what I’m going to be accomplishing is in R2, but it’s not RTM yet and as such I need to act just like it doesn’t exist.

It has a new name now, the OpsMgr Alert Wrangler. It’s much like some of the code I’ve written here, except for it uses an XML config file instead of having everything hardcoded, and it hopes to be a little bit smarter about how it accomplishes things. This is really my first real foray into programming anything serious, so once it’s at a stable enough place I’ll be throwing it on CodePlex so you can all make fun of me and tear it apart.  :)

There is an additional method to narrow alerts, and it seems like it would really work well - and that is the Alert Category; right now it has things like availability, DSIntegration, performance, custom, etc etc. I can’t find a way to properly add a new category - yet. By all accounts, the SDK documentation says I can’t - the categories are static coded members of the EnerpriseManagement.Configuration namespace, but that’s not to say there isn’t something undocumented. I’ll keep tapping away at it.

I need to bang together a new contest, and this time give away something really good, like some copies of Sapien Primalscript and such - which will come soon when I finish my ‘I <3 Primalscript’ post fairly soon.

I also to work more on the Wiki, work on my video Q&A, and about 2 dozen other things - there’s really a free moment!

Posted in Pavleck.NET, SCOM, SDK | 1 Comment »

PowerShell v2 CTP3 released, works fine with OpsMgr

Posted by Jeremy D. Pavleck on December 23rd, 2008

I would have posted this yesterday, but I wanted to do some testing first. Twelve hours ago the PowerShell team announced the release of V2 CTP3. It adds a lot of great things into the mix. I wanted to verify that it plays well with OpsMgr and as suspected it does.

Just a note - you’ll need to install PowerShell v1 for a new OpsMgr install. But you can then remove it and install a newer version. I typically run the newest v2 CTP release on my laptop, though I remain at v1 on the production servers.

Happy holidays all!

Posted in Pavleck.NET, Powershell, SCOM | No Comments »

Just a bit of PoSh - show your battery level at the prompt

Posted by Jeremy D. Pavleck on December 19th, 2008

I’ve been working on a new, more condensed version of the OpsMgr PoSh library - one of the coolest features I think is the ‘location awareness’ which automatically switches your management server and such based on where you’re actually connected from.

Anyway, to do that I was embedding things in function prompt {}. In case you aren’t aware, if you define the prompt function, whatever is in there will run everytime you return to the prompt in the console. You can use this to your advantage for many things, such as this nifty little battery gauge that lets you know how much juice is left. It also has a configurable global variable, BatteryDisplayAtPercent, which you can set so it will hide until there is that much charge or less remaining.

First a screenshot, then the script:

battery-prompt

# ==============================================================================================
#
# Microsoft PowerShell Source File — Created with SAPIEN Technologies PrimalScript 2007
#
# NAME: Battery-Prompt.ps1
#
# AUTHOR: Jeremy D. Pavleck , Pavleck.NET
# DATE  : 12/14/2008
#
# COMMENT: Lists the percentage of battery remaining above your prompt inside the console.
#    Difficulty level: OVER 9000!!!!!!!!!!!!!!!!
#
# ==============================================================================================
$GLOBAL:BatteryDisplayAtPercent = 101 # When you should start displaying status
# Anything over 100 means to show it all
Function GLOBAL:Get-BattLevel($minLevel) {
$charge = (Get-WmiObject -Class Win32_Battery).EstimatedChargeRemaining
If(!$charge) {break} # Not on a laptop, or no battery, so exit
Switch($charge) {
{($charge -ge 101) -and ($minLevel -ge 101)} {Write-Host "Batt: CHARGING" -ForeGroundColor Green}
{($charge -ge 80) -and ($charge -le 100) -and ($charge -le $minLevel)} {Write-Host "Batt: $charge%" -ForeGroundColor Green}
{($charge -ge 40) -and ($charge -le 79) -and ($charge -le $minLevel)} {Write-Host "Batt: $charge%" -ForeGroundColor Yellow}
{($charge -ge 16) -and ($charge -le 39) -and ($charge -le $minLevel)} {Write-Host "Batt: $charge%" -ForeGroundColor Magenta}
{($charge -ge 1) -and ($charge -le 15) -and ($charge -le $minLevel)} {Write-Host "Batt: $charge%" -ForeGroundColor Red}
default {break}
}
}

function prompt() {
Get-BattLevel $GLOBAL:BatteryDisplayAtPercent
}

Posted in Powershell | 2 Comments »

OpsMgr Video Experiment: Ask About OpsMgr

Posted by Jeremy D. Pavleck on December 18th, 2008

I’ve been reading and hearing all over the place how complicated and difficule Operations Manager is. You’re half-right. It’s immensely complicated when compared to previous editions, and when it’s your first exposure to it. I’m aiming to change all that, and I’m trying it in a new medium - video! So watch the video below (Or if your firewall rules don’t prohibit it, go directly to the YouTube link) and post a video response asking me your question. Any question.

I’ll do my best to answer it with the help of the OpsMgr Army and screencast it all!

Posted in Pavleck.NET, SCOM | 5 Comments »

Management Pack Authoring 101

Posted by Jeremy D. Pavleck on December 17th, 2008

This post deals with 2 situations I’ve come across time and time again. One is the lack of documentation about any customizations made and the other is the general lack of any decent tutorials on using the authoring console - so I’ll combine them!

Documentation - the bane of any monitoring engineer. With a system such as OpsMgr, a lot of it is self-aware and as such, rules and monitors will deploy on their own according to what happens in a server. Someone installs IIS? Well then OpsMgr will notice and download the appropriate rules and monitors and assign them to the new groups they belong to.  That’s a tough thing to stay on top of, and once I have an OpsMgr 07 version of MOMDOC, I’ll release it and make all of our lives easier - until then you’ll have to put up with it.
The other side of documentation is the general lack of it with regards to custom rules, monitors, transactions and changes made to ‘out of the box’ rules. This is a very solveable problem!

First off, go ahead and download the Authoring Console. It’s been out for 8 months now, and technically not needed for this particular management pack, but it’s a great way to ease into how it all works.

For this demonstration, I’m going to create a management pack which makes a new task called “Search Internal Documentation”. This task simply opens a browser window appending the alert name to a URL for an internal ScrewTurn Wiki. ScrewTurn is a great open-source ASP.Net wiki which doesn’t require an SQL database, making it very easy to ’sneak in under the radar’ in a lot of environments.

After you’ve downloaded, installed, and opened the Authoring Console, click on File > New, to create a new management pack. Under “Management Pack Template” click on “Empty Management Pack” and give it a name - I used Internal.Documentation.Search

Selecting an MP template and name it

Selecting an MP template and name it

Click on “Next” and give it a Display Name and Description. Use what I did, or enter your own information.

Entering display name and description

Entering display name and description

Immediately you’re assaulted with a whole army of choices; Sevice Model, Health Model, Presentation, Type Library, Language Packs, and all of the things inside of those. We’ll get to all of those, eventually, but for now click on the ‘Presentation’ tab on the left, then New and Console Task on the right.

SCOM - New Console Task

SCOM - New Console Task

Up will pop up a window asking for a unique identifier. This is an internal reference used inside the Management Pack, so give it a descriptive name, something like “Search.Wiki”.

Choosing a Unique Identifier

Choosing a Unique Identifier

Click ok, and now you have all of the options for our new task.

The ‘General’ tab is where you give your task a public name, description and choose the target. You can see from my example I’ve named this task “Search the Wiki” with the description of “Search the internal wiki about this alert”. Under the target click to expand it, choose ‘Browse all classes’, then search for the “System.Entity”. This will allow our task to be shown and run against all alerts from all management packs.

The general pane of the new task window

The general pane of the new task window

Now click on the ‘Command Line’ tab - this is where the meat of it is. Here is where we define exactly what our task will do.

Command Line pane showing the definitions for the task

Command Line pane showing the definitions for the task

As you can see from my example above, I’ve specified the command line options to open up our Wiki. The command line application was set to use Internet Explorer1, and the parameter I use is the URL t0 the wiki with $NAME$ (The alert name) and “.ashx” appended to it.

Tip: If you’d rather have the URL opened in whatever the default browser the user has, you can change the application to use start.exe to open it, or even just use the URL itself. If it’s a known extension, it will be opened by whatever the default handler is for it.

Product knowledge is what we’re used to, enter what you see fit in here, then click on the Options tab and change Accessibility to “Public”, and Category to “Alert”. This allows the task to be used directly from the console, and shown in any alert view.

Setting the additional options

Setting the additional options

Then click OK, it will crunch for a little bit saving your changes, and then bam - there you go - a brand new task is born!

The completed new task

The completed new task

Now click on File > Save, choose a spot (and a name if you’d like) and there you have it, a brand new management pack. Now go ahead and import it, like you’d import any management pack. Click on the Monitoring tab, then on Active Alerts and select an alert. In the actions pane you should see our new task shown under the “Alert Tasks” heading.

Our new 'Search the Wiki' task

Our new 'Search the Wiki' task

For this example I highlighted an alert that was “Percentage of Committed Memory in Use Too High” and clicked on ‘Search the wiki’. Since that page doesn’t yet exist, it suggested a few I’ve created that sound close to it, or alternatively you have the option to create it as a brand new page. Pretty slick, eh?

scom-authoring-10-examplewebpage

  1. If you use a different default browser at your organization, then enter it’s path here []

Posted in Authoring, SCOM | No Comments »

Congrats to our winners!

Posted by Jeremy D. Pavleck on December 12th, 2008

Congratulations are in order to Jim and Zolon, they won an autographed Operations Manager 2007 Unleashed and a Sapien Schwag pack - who will win next? Maybe it’s you! The prizes are getting better and better!

Thanks guys, I’ll be sending them out asap!

Posted in Contests, Pavleck.NET | No Comments »

TODO: Enter snappy title

Posted by Jeremy D. Pavleck on December 10th, 2008

Please forgive the delay in posts, but trust me, I’ve been busy.

Shortly after this post I’m going to make a valiant attempt to get the new site up. Though I’ve learned that to import a Wordpress blog into Drupal, I need to install Drupal 5, run an import, then upgrade to 6. So yeah, we’ll see how that goes.

For the past several days I’ve been in an MS workshop entitled ‘Vital Signs’. It’s essentially a performance tuning course which focused on the counters and thresholds to watch out for. To commemorate the occassion, I’m working on a Windows Diagnostics Management Pack - which is mostly a group of tasks to run against a remote machine - collecting a variety of counters and analyzing it via SPA.

You’ve got about 5 hours to enter the contest, and then it’s all done. I’ve lined up additional items for upcoming contests, such as the top notch screen capture program Snagit by TechSmith. Thanks to them for that!

And I’ve been doing a lot of non-OpsMgr powershell work. Since I did intend for Pavleck.NET to include ‘general’ IT topics, I think I should start posting them - been working on a bunch of Amazon web services stuff.

Anyway, off to work on this upgrade!

Posted in Contests, Pavleck.NET | No Comments »

Contest extended, Wiki Updated

Posted by Jeremy D. Pavleck on December 2nd, 2008

Hey folks!

I’ve gone an extended last month’s contest a couple of weeks because I’m waiting for my lanyards to show up AND I really want more people to have signed up, because the prizes are just going to keep on getting better! So if you haven’t, go sign up @ Contest Machine - I don’t keep any personal info, seriously!

I’ve also worked over the weekend to cleanup the OpsMgr Wiki some - so please have a look. You can find all of the Command Shell cmdLet help, there’s a snapshot of the MS OpsMgr blogs, and even some management pack version info.

Additionally, the next few things I’m working on are an extension to the OpsMgr audible alert - I’ll show you 2 more ways to do it; Via WinRM & PowerShell and via a custom web service and connector. Look for that, soon!

Posted in Authoring, Contests, Management Packs, Pavleck.NET, SCOM, SDK | No Comments »

System Center VUG today & The new Google

Posted by Jeremy D. Pavleck on November 21st, 2008

Scott Moss shot me an IM a little bit ago to remind me about the System Center Virtual User Group that’s happening today (November 21st, 2008) at 1:00 PM Central time. Here’s the ClickToAttend.Com Link to the event - feel free to add this to your Google Calendar.

Speaking of Google!

Google is slowly rolling out new features for a select group of users. It’s a wiki-fied version of search with promote/demote buttons and a comment area. This will help you pick the more authorative links among a list - unless someone has hired an army to promote a malware site, which I wouldn’t put past the modern web.

Anyway, here’s a screen shot of what the new interface looks like, and a short video afterwords.

The new wiki-like features of Google search

The new wiki-like features of Google search

And a screencast!

Posted in Command Shell, Community, WMI | 3 Comments »

Coming Soon: New Pavleck.NET Here Now: OpsMgr Wiki

Posted by Jeremy D. Pavleck on November 20th, 2008

As I add more and more things to this site, Wordpress ceases to be able to properly handle it all - it’s time to move up to a more suitable CMS. So upon the advice of fellow #powershell member Sepeck, I’m moving it all over to a nice and shiny Drupal install.
With a proper CMS, you’ll have a much easier time accessing all of the scripts, downloads, tips & tricks, and contests offered here - and I won’t have to fight with the system so much to get it to do what I want it to do. You’ll also find an awesome time saver; the combined OpsMgr Feed Aggregator - featuring all of the major players in the OpsMgr world on one page.  Like today, it would have been covered with a solid wall of “R2 beta is out!”.

Additionally, there is something that’s in enough of a ready state to show you. It’s in a fairly rough state right now as I steal time to clean things up, but I present to you the Pavleck.NET OpsMgr Wiki. It’s based on the wonderful Deki Wiki software, and I’m quickly falling in love with it. And thanks to some PoSh goodness by Jaykul, you can see the get-help for all of the Command Shell cmdlets. Right now I’m using the free version until I figure out just how active and used it is - the Pro version is only $99 though. Although that’s not the most expensive price in the world, it will take a little time for me to budget - unless you’d like to help. Any donations received go towards the improvement of this site AND awesome prizes to give away to you all! Feel like donating? Awesome! Please click the button below:


Everyone who donates at least $5 will receive a free Pavleck.NET lanyard. They aren’t here yet but they will be. And might I add, they do look quite stunning! Get rid of that company-logo’d cheapie with a high quality Pavleck.NET lanyard. 5/8″ thick, silkscreened logo onto the strong polyester. And it features a break away so you don’t kill yourself, and so you can pop those thumb drives off in 3 seconds. Donations of $10 or above will have a chance to see attached to that Lanyard a 4, 8, 16, or even a ginormous 32GB Corsair Flash Voyager USB drive! So open those eWallets ;).

This is a lanyard to be proud of!

This is a lanyard to be proud of!

Posted in Community, Pavleck.NET, SCOM | No Comments »