Search Blog
spacer
You must be logged in and have permission to create or edit a blog.
 
Author: Created: Tuesday, September 09, 2008 1:58:59 PM RssIcon
News and updates about code4ward, Royal TS and other geeky stuff...
By Stefan Koell on Wednesday, November 12, 2008 5:09:08 PM

back_soonThe next 2 weeks I'm in Redmond and Seattle. I'm attending the TAP meeting for the next OpsMgr release and some friends are attending a SQL server conference in Seattle. Anyhow, I have now the chance - for the first time - to see the MS campus and I am really excited about it. Of course, I am also looking forward to meet all the nice guys from the OpsMgr product team.

When I'm back I will continue the work on the release of Royal TS 1.6.0. The code is pretty much ready to roll.

One little teaser: Royal TS will sport a very flexible way to execute tasks (command line) on one or more connections. You will have access to almost all connection settings from these commands by using special variables. I'm sure you'll love it.

By default I will ship at least 2 pre-defined tasks: "ping.exe $Hostname$" and "ping.exe $Hostname$ -t"

For those who like to use a "Wake On LAN" helper tool, someone could easily implement a task like "wol.exe $PhysicalAddress$"; yes a new field to store the MAC address was added too Open-mouthed

Everybody can create new tasks and extend Royal TS. For example: starting the eventviewer or computermanagement MMC for the selection. Open a directory, file or URL. And many, many more.

By Stefan Koell on Tuesday, November 04, 2008 6:04:06 PM

image As maybe many of you observed as well, the Remote Desktop components shipped with Vista and XP SP3 (especially XP!) are not as stable that the previous versions. My personal experience includes sudden disconnects (when heavy graphics in the remote sessions are involved) as well as "stuck" sessions. These sessions are stuck when you try to gracefully disconnect a remote session. Somehow - and don't ask me why - the remote desktop component thinks it must try to reconnect, which never happens. The nice reconnect screen has a disabled or useless "Cancel" button. So, the session is "stuck".

Only remedy (now): Shutdown Royal TS and restart it.

Royal TS get's a new menu item "Force Disconnect" to destroy the ActiveX control itself by force and should only be used in that rare occasion.

By Stefan Koell on Tuesday, November 04, 2008 4:46:59 PM

... but those who are may have received a conference guide like this:

image

How do you spell connect?

Thanks to David Allen for this.

By Stefan Koell on Tuesday, November 04, 2008 3:58:06 PM

My new and shine web site just got the new blog module (3.05.00). So far everything's fine and I already post from Windows Live Writer without any plug-ins and stuff. smile_teeth

By Stefan Koell on Tuesday, October 21, 2008 10:11:17 PM

I got a lot of feedback lately, that Royal TS needs an import functionality. I completely agree, but I soon realized, that almost everyone has different requirements. So thinking through all possibilities and providing a powerful UI which can handle all different requirements would be very time consuming.

So I thought, providing a sample script which shows how this can be done should get you started...

Click here to get to the script.

By Stefan Koell on Tuesday, October 21, 2008 9:23:56 PM

As most of you already saw, code4ward got a complete new face. Here some facts about the relaunch:

  • Join The DotNetNuke Powered! ProgramThe new web page runs on the DotNetNuke platform. I never was a huge fan of DotNetNuke and if I could, I would still try to avoid using it. Don't get me wrong, I think it's a great platform with a great value and a huge and very professional community attached. I just really don't like dependencies...
  • The skin is a professional one, which was bought and customized. I am really happy with the look of the site.
  • Some of the graphics were made by a friend of mine who is a very talented designer with fresh and crazy ideas. Thanks Armin! Some other graphics came from iStockPhotos
  • The previous site (based on Community Server) was hosted on a machine at my place. My bad experience with my (lately very unstable) ISP forced me to move the site somewhere else. A friend of mine (Netmonic) offered me to host my virtual machine for a very low monthly rate. So in fact, this is quite new: Now I not only have to pay for power and an internet connection, I also must pay for hosting; not much but still.
  • The web site is now hosted on a Windows 2008 / IIS 7 machine running SQL Server 2008. Was quite a learning experience.
  • The download tracking and statistics code was self written. It's a C# HTTP Module using LINQ. I will soon release the code for that.
By Stefan Koell on Thursday, September 25, 2008 12:05:05 PM

ComponentFactory is offering their Krypton Suite (Value: $299) for free to MVPs and .NET bloggers. Go, ckeck it out here: http://www.componentfactory.com/blog/?p=328

By Stefan Koell on Thursday, February 28, 2008 7:35:37 AM

CheckServiceState Script CheckServiceState Script

If you ever wanted more control how to monitor windows services with Operations Manager 2007 you most likely realized, that you have to do it all by yourself with a custom script.

I had at least two major problems which forced me to use a custom script:

  • It seems that you cannot monitor the status of a service which has the startup type set to "Manual". (There is a parameter in the overrides dialog called "Alert only if service startup type is automatic" but it doesn't have any effect, the health state simply doesn't change)
  • When using templates to monitor a windows service you cannot override the monitor to only monitor a subset of services using a group. The group just doesn't show up in the list

So this is my approach to windows service monitoring:

First of all, let's set up a Windows Service monitoring using the standard Management Pack Templates Wizard. In this example: "Print Spooler". In the monitoring wizard select or create a destination management pack, here: "Windows Service Monitoring".

I use the template wizard because I can use the discovered service class to target my own script and I get all the other goodies (performance monitors, baseline rules, etc).

After a while the service you just configured to monitor will be discovered. Now let's setup a group:
Create a new group with a name like "Print Spooler Service Group" in the "Windows Service Monitoring" management pack. In this example I use explicit group members but you can also use dynamic membership of course. The beauty is, that your group can (and should) contain the discovered service instances:
bws1

Next, bring up the monitors the template wizard creates for us:
bws2

There you should see the (very inflexible and buggy) availability monitor:

bws3 

Right-click on the "Service Running State" monitor and select "Overrides > Override the Monitor > For all objects of type: Print Spooler". In the Override Properties, disable the monitor (check "Override" for the Parameter Name "Enabled" and change the "Override Setting" to "False").

Next, right-click on the "Availability" node and select "Create a monitor > Unit Monitor...". In the unit monitor dialog, select the "Scripting > Generic > Timed Script Two State Monitor" as monitor type and place it in the same Management Pack "Windows Service Monitoring".

In the General properties page we can now target the script to the "Print Spooler" class. Also be sure to disable the monitor by default (We enable it later using a group override).
bws4

Pick a schedule which makes sense to you (I recommend every 5 minutes but depending on your environment I suggest that you don't go below 2 minutes).

In the Script page, provide a script name, like CheckServiceState.vbs and paste the attached script into the script area.

The script takes 3 parameters (documented in the script) but for a standard scenario you can just use:
"$Target/Property[Type="MicrosoftSystemCenterNTServiceLibrary!Microsoft.SystemCenter.NTService"]/DisplayName$" "Running" "Auto"

Because we already target the print spooler class we can use a dynamic parameter to pass on the service name. Parameter 2 and 3 (which is optional) can be used to define the desired status and startup type. Please be sure to encapsulate each parameter in double-quotes - just to be on the safe side.

Next let's define the health expressions:
bws5 
bws6 
bws7

And finally the alert:
bws8

I suggest an alert description like:
The state of the monitored service '$Target/Property[Type="MicrosoftSystemCenterNTServiceLibrary!Microsoft.SystemCenter.NTService"]/DisplayName$' on '$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$' is invalid: $Data/Context/Property[@Name='AlertText']$

After you created your monitor, enable it using an override for the group we created earlier.

As last (optional) step I suggest to create a state view containing the Print Spooler instances and scoped to the group where we enabled the monitor.
bws9

Of course, it would be much better if that functionality and flexibility is provided by OpsMgr out of the box...

cheers

By Stefan Koell on Tuesday, December 18, 2007 3:00:37 AM

Once again, a little post to share with you guys about Operations Manager Tasks - this time using Powershell. First a little background story: Current version of Operations Manager 2007 (SP1RC) has still some nasty bugs and it seems that especially the events view doesn't get much attention from the product team.

The event view doesn't HTML-Encode the event description in the details pane. Which is bad if you have to look at events (published exceptions for example) with fragments of XML or HTML included. This information just doesn't appear in the preview pane.

So, the first thing which came to my mind is: Ok, then. How about some kind of console task which executes a quick Powershell command to dump out the event details using the Get-Event Cmd-Let.

Next Problem: You can create an event task and put a dynamic parameter $ID$ in it. However, starting the task using the actions pane on the right always passes the same ID (I guess the ID from the first event selected when the view gets loaded) to the task - regardless which event was selected!

Lucky me, there is a workaround: When you execute the task using the Actions menu in the console, the task will always get the ID from the selected event.

So, now the interesting stuff: How to setup such a task?

  • First create a console task for events using the authoring section in the console.
  • When defining the command, set the application to: C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe
  • Set the parameter to: -PSConsoleFile Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Console.psc1 -NoExit .\Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Startup.ps1;Get-Event -Id $ID$
  • Set the working directory to: C:\Program Files\System Center Operations Manager 2007
  • Finally, uncheck the "Display output when the task is run" checkbox

That's it. Enjoy...

By Stefan Koell on Wednesday, September 19, 2007 2:43:37 AM

In MOM 2005 it was easy to notify someone on specific alerts. SCOM 2007 - with it's subscription based system - cannot handle these kind of notifications. But the limitation is the user interface. Jakub from the SCOM 2007 product team released some very useful code which helped to implement a notification based on the alert name. One problem of Jakubs code is, that it's a C# program which is not very handy and that he creates most of the stuff in code which can be created with the UI.

I translated the script to power shell, which should be much friendlier to use, deploy and let's you quickly tweak some settings. The code below works for me (at least working with email notifications), but I have to admit, I didn't test it that much. The script usage is pretty simple, but you have to do some stuff first:

  • Setup email notification
  • Create at least one recipient
  • The alert has to be raised at least once
  • Change the $RMS variable in the script to your root management server

Then, just execute it in Power Shell: ".C:\Set-NotificationForAlert.ps1 "This is a test alert" "This is a test notification recipient"

Parameter 1: The name of the alert

Parameter 2: The name of the recipient

So, hopefully I can ease some pain with this...

File

 Set-NotificationForAlert.ps1

spacer
dummy