Archive for October 7, 2012

Read log file in the Console

Below is guide how to show/read a log in the SCOM console.
  • Open SCOM Console
  • Goto Authoring
  • Open Management Pack Objects
  • Right Click Task
  • Choose ‘Create a New Task’
  • Select Agent Task – Command line, and choose the right Manamgement Pack(never choose ‘Default Management Pack”)
  • Give it Task name, Description and choose the Task target.
  • In ‘Full path to file’ type cmd.exe, and in ‘Parameters’ type /c type “[FILE LOCATION]”

Check if Rule/Monitoring Running

1. Open the UI 🙂
2. Go to the Monitoring Node
3. Go to the Discovered Inventory View
4. By default this view is scoped to Computer, you will want to change this by looking at the right Actions pane under State Actions. Hit “Change target type…”
5. In the :Look For” text box type “Health Service” and select it from the list below. The view will now refresh.
6. Select the health service you want to see if the rule/monitor is running for. The right pane will now change and Health Service Tasksshould appear under State Actions.
7. Select “Show Running Rules and Monitors for this Health Service” and run it.
8. You can also run “Show Failed Rules and Monitors for this Health Service”

Sealing a Management Pack

Sealing a Management Pack is easy. Although, it can be frustrating the first time through. It’s a process that requires a few different pieces to interact, so preparation is key. Going through some simple steps now will save time in the future.

  • Create a directory somewhere on a workstation where you’ll be sealing MP’s. For this example, I created the directory c:\MPS
  • I also created four directories within c:\MPS
    • \Input – this directory will contain the MP to be sealed (the xml file)
    • \Output – this directory will contain the sealed MP (the final mp file)
    • \MP – this directory will contain all referenced MP’s
    • \Key – this directory will contain the pair key file
  • Copy MPSeal.exe from the source installation files “SupportTools” directory to the c:\MPS directory.
  • Copy sn.exe to the c:\MPS directory
  • Copy your unsealed MP (xml file) into the \Input directory
  • Copy all the *.mp files from the RMS installation directory into the \MP directory
    • Usually “%Program Files%\System Center Operations Manager 2007\”
  • Also, copy all *.mp files that you’ll be referencing to the \MP directory
    • TIP: I’d just keep this directory updated with all available current MP’s (ie; Active Directory, Exchange, etc)

Finally, the c:\MPS directory will look like this.

image

The two files highlighted:
Command.txt is just a file I created that contains the commands needed to seal the management pack. The MPResources.resources file is automatically created while sealing management packs. This is not anything you’ll need to copy into the directory.

Now, we’re ready to seal our Management Pack.

Open a command prompt and navigate to your work directory (c:\MPS). Run these commands in sequence. (beware of word wrap with these commands)

  • sn -k c:\mps\key\PairKey.snk
  • sn -p c:\mps\key\PairKey.snk c:\mps\key\PubKey
  • sn -tp c:\mps\key\PubKey
  • mpseal c:\mps\input\unsealed_mp.xml /I “c:\mps\mp” /Keyfile “c:\mps\key\PairKey.snk” /Company “Your Company” /Outdir “c:\mps\output”

You should now have your sealed MP in the Output directory. And, you’ll have a working directory for later use. Just remember to keep the MP versions in the c:\MPS\MP directory current with your Management Groups. Otherwise, you’ll get version errors while attempting to run the MPSeal tool.

Hint: Once you’ve created the key the first time around, it’s not necessary to create a new key each time you seal a MP. The current key may be reused. So, the only step you’ll need to actually do after the first run is the last step. How’s that for easy!

A note to developers: I’ve had some questions about where the MPResources.resources file mentioned above is created. Specifically, if two build flavor threads (x64 and x86, for example), compiles at same time and try to create this file under sources, one build thread will break.

To solve that problem, execute MPSeal from a different location. Examples below.

This will create the MPResources.resources file in the users %temp% directory.clip_image002

This will create the MPResources.resources file in the x86 directory I created.clip_image004

This will create the MPResources.resources file in the x64 directory I created.clip_image006

Operation Manager Command Shell on any system

This is a basic guide to get a Operations Manager Command shell on any system without having to install the UI components. You will need to have Powershell and DotNet 3.0 installed on the system.Copy the Files

You will need to copy some files from your Ops manager install to get the command shell working.

From the Ops Manager installation directory:

Microsoft.EnterpriseManagement.OperationsManager.ClientShell.dll Microsoft.EnterpriseManagement.OperationsManager.ClientShell.dll-help.xml Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Format.ps1xml Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Types.ps1xml

From the SDK Binaries Folder in the Ops Manager installation directory:

Microsoft.EnterpriseManagement.OperationsManager.dll
Microsoft.EnterpriseManagement.OperationsManager.Common.dll

Copy these files to a folder on the system you want the command shell on. For this example I will copy them to C:\OpsShell.

Register the Powershell Snap-in

For the Powershell snap-in to work we need to register it. As we are not installing the UI this will have to be done manually. Add the below registry settings replacing “C:\\OpsShell” in the following regsitry entries with the correct path to the files.

———–

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellSnapIns\Microsoft.EnterpriseManagement.OperationsManager.Client] “ApplicationBase”=”C:\\OpsShell” “AssemblyName”=”Microsoft.EnterpriseManagement.OperationsManager.ClientShell, Version=6.0.4900.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35” “ModuleName”=”C:\\OpsShell\\Microsoft.EnterpriseManagement.OperationsManager.ClientShell.dll” “PowerShellVersion”=”1.0” “Vendor”=”Microsoft Corporation” “Version”=”6.0.4900.0” “Description”=”Microsoft Operations Manager Shell Snapin” “Types”=”C:\\OpsShell\\Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Types.ps1xml” “Formats”=”C:\\OpsShell\\Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Format.ps1xml”

———–

Create the Startup Script

Below is a Powershell script that you can use as a shortcut to start the Command Shell. Copy it to notepad and save it in C:\OpsShell as OpsShell.ps1. Some of the script was borrowed from here

———–

param ($rootMS)

$rootMS.Length
if ($rootMS -eq $null)
{
$rootMS = Read-Host “Root manangement server”
}

$checksnappin = Get-PSSnapin | where {$_.Name -eq “Microsoft.EnterpriseManagement.OperationsManager.Client”}
if ($checksnappin -eq $null)
{
add-pssnapin “Microsoft.EnterpriseManagement.OperationsManager.Client” -ErrorVariable errSnapin ;
}
Set-Location “OperationsManagerMonitoring::” -ErrorVariable errSnapin ;
new-managementGroupConnection -ConnectionString:$rootMS -ErrorVariable errSnapin ;
set-location $rootMS -ErrorVariable errSnapin ;

———–

Starting the Command Shell

To start the Command Shell open powershell and run C:\OpsShell\OpsShell.ps1.

If you get the error:

File C:\OpsShell\OpsShell.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details.

Then run this command to change the execution policy:

Set-ExecutionPolicy Unrestricted

This works for me on XP SP2 and Server 2003 SP2

This could be expanded to offer the ability for our server admins to do things such as set Maintenance Mode on or off without having to do it in 3 different locations in the console as is currently needed.

Orphaned Agents

Please run the following query to list all orphaned Agents, please verify if this contains the Agents.

NOTE: This not a support solution from Microsoft

 

— Check for orphaned health services (e.g. agent).

declare @DiscoverySourceId uniqueidentifier;

set @DiscoverySourceId = dbo.fn_DiscoverySourceId_User();

 

SELECT TME.[TypedManagedEntityid], HS.PrincipalName

FROM MTV_HealthService HS

INNER JOIN dbo.[BaseManagedEntity] BHS with(nolock)

ON BHS.[BaseManagedEntityId] = HS.[BaseManagedEntityId]

— get host managed computer instances

INNER JOIN dbo.[TypedManagedEntity] TME with(nolock)

ON TME.[BaseManagedEntityId] = BHS.[TopLevelHostEntityId]

AND TME.[IsDeleted] = 0

INNER JOIN dbo.[DerivedManagedTypes] DMT with(nolock)

ON DMT.[DerivedTypeId] = TME.[ManagedTypeId]

INNER JOIN dbo.[ManagedType] BT with(nolock)

ON DMT.[BaseTypeId] = BT.[ManagedTypeId]

AND BT.[TypeName] = N’Microsoft.Windows.Computer’

— only with missing primary

LEFT OUTER JOIN dbo.Relationship HSC with(nolock)

ON HSC.[SourceEntityId] = HS.[BaseManagedEntityId]

AND HSC.[RelationshipTypeId] = dbo.fn_RelationshipTypeId_HealthServiceCommunication()

AND HSC.[IsDeleted] = 0

INNER JOIN DiscoverySourceToTypedManagedEntity DSTME with(nolock)

ON DSTME.[TypedManagedEntityId] = TME.[TypedManagedEntityId]

AND DSTME.[DiscoverySourceId] = @DiscoverySourceId

WHERE HS.[IsAgent] = 1

AND HSC.[RelationshipId] IS NULL;

 

 

Then please follow these steps which will bring these Agents back to Pending Management, from here please approve the Agents.

 

1. Backup the OperationsManager database

2. Run the below SQL queries to remove the orphaned agents.

 

— DELETE!!! all orphaned agents.

declare @TypedManagedEntityId uniqueidentifier;

declare @DiscoverySourceId uniqueidentifier;

declare @LastErr int;

declare @TimeGenerated datetime;

 

set @TimeGenerated = GETUTCDATE();

set @DiscoverySourceId = dbo.fn_DiscoverySourceId_User();

 

DECLARE EntitiesToBeRemovedCursor CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR

SELECT TME.[TypedManagedEntityid]

FROM MTV_HealthService HS

INNER JOIN dbo.[BaseManagedEntity] BHS

ON BHS.[BaseManagedEntityId] = HS.[BaseManagedEntityId]

— get host managed computer instances

INNER JOIN dbo.[TypedManagedEntity] TME

ON TME.[BaseManagedEntityId] = BHS.[TopLevelHostEntityId]

AND TME.[IsDeleted] = 0

INNER JOIN dbo.[DerivedManagedTypes] DMT

ON DMT.[DerivedTypeId] = TME.[ManagedTypeId]

INNER JOIN dbo.[ManagedType] BT

ON DMT.[BaseTypeId] = BT.[ManagedTypeId]

AND BT.[TypeName] = N’Microsoft.Windows.Computer’

— only with missing primary

LEFT OUTER JOIN dbo.Relationship HSC

ON HSC.[SourceEntityId] = HS.[BaseManagedEntityId]

AND HSC.[RelationshipTypeId] = dbo.fn_RelationshipTypeId_HealthServiceCommunication()

AND HSC.[IsDeleted] = 0

INNER JOIN DiscoverySourceToTypedManagedEntity DSTME

ON DSTME.[TypedManagedEntityId] = TME.[TypedManagedEntityId]

AND DSTME.[DiscoverySourceId] = @DiscoverySourceId

WHERE HS.[IsAgent] = 1

AND HSC.[RelationshipId] IS NULL;

 

OPEN EntitiesToBeRemovedCursor

 

FETCH NEXT FROM EntitiesToBeRemovedCursor

INTO @TypedManagedEntityId

 

WHILE @@FETCH_STATUS = 0

BEGIN

BEGIN TRAN

 

— Delete entity

EXEC @LastErr = [p_RemoveEntityFromDiscoverySourceScope] @TypedManagedEntityId, @DiscoverySourceId, @TimeGenerated;

IF @LastErr <> 0

GOTO Err

 

COMMIT TRAN

 

— Get the next typedmanagedentity to delete.

FETCH NEXT FROM EntitiesToBeRemovedCursor

INTO @TypedManagedEntityId

END

 

CLOSE EntitiesToBeRemovedCursor

DEALLOCATE EntitiesToBeRemovedCursor

 

GOTO Done

 

Err:

ROLLBACK TRAN

GOTO Done

 

Done:

Error “The gateway name already exists as a computer instance.”

Problem
I ran into a situation where I could not get a gateway server to approve via the Microsoft.EnterpriseManagement.GatewayApprovalTool.exe. It was erroring out saying that “The gateway name already exists as a computer instance.”.
I am getting Event ID 20000 on the Management Server and Event IDs 20070 and 21016 on the gateway.
Resolution
You will need to remove the computer name from the Agent Manged list. The supported method of doing this is to delete from the admin console(Administration > Device Manager > Agent Managed). But in some case you can’t find it in the console. If it is the case you need go the database for Ops Mgr, find the tabel called dbo.MT_Computer and open it. Find PrincipalName where it match and delete the row

Free Disk Space Report – Disk Capacity Reporting

As an example for how to actually create reports within the new Operations Manager 2007 reporting interface I started with the question: “How do I generate a report for free disk space on servers monitored by OpsMgr?”
The easy approach is not to use a report for this, but rather to use the Operations Console directly to provide a graph. This can be done through the Operations Console / Monitoring / Microsoft Windows Server / Performance / Disk Capacity. This view also allows you to specify how long the graph should show data through clicking on the Select Time Range option. (Free Disk Space 1 graphic below)
The second option I have found is to create a report based upon the built-in Performance report. This is done through:
In the Operations Console open Reports / Microsoft Generic Report Library / Performance

 

  1. Double-click on the Performance report
  2. Set the date to Yesterday as a starting Date
  3. Click Change to configure the report
  4. Click on the New Chart button (Free Disk Space 2 graphic below)
  5. Click the Add Object button
  6. Type in C: for the field next to Object Name. (Free Disk Space 3 graphic below)
  7. Add the first server off of the list and click Ok.
  8. Click New Series
  9. Click on the Add Object
  10. Object contains C:
  11. Add the next server off of the list and ok.
  12. Repeat steps 9-12 until all servers / drives required for the report are added.
  13. Click on the first of the three series shown in the chart and click on the Browse button under Rule.
  14. Choose Search by Counter.
  15. Choose the Performance object of LogicalDisk.
  16. Choose the Counter % Free Space and Search.
  17. Add % Logical Disk Free Space. (Free Disk Space 4 graphic below)
  18. And press Ok.
  19. Perform the same action for the remaining counters. Click Ok when completed. (Free Disk Space 5 graphic below)
  20. Click the Run button to run the report.
  21. Do a file/save to Favorites to make the report accessible after you have configured it!

Source: http://cameronfuller.spaces.live.com/Blog/cns!A231E4EB0417CB76!936.entry

nworks – Refresh Hardware Information

Refresh Hardware Information

New postby wbn » Mon Apr 12, 2010 1:41 pm

NWORKS IS CAUSING THE HOST TO “Refresh Hardware Information” TO MANY TIMES. SEEMS THIS IS CONSTANTLY POPPING UP ON THE VIRTUAL HOST. WHAT CAN I DO TO DECREASE THIS?

Wayne Braden
U.S. Department Of Energy

wbn
Lurker
Posts: 1
Joined: Mon Apr 12, 2010 1:27 pm
Full Name: John Wayne Braden

 

Re: Refresh Hardware Information

New postby Alec King » Mon Apr 12, 2010 2:22 pm

Hi Wayne,

This event “Refresh Hardware Information” is required due to a known limitation in the VMware API….the vCenter API does not automatically keep the current hardware status of the ESX hosts.

So in order to have current status of power supply, temperature sensors etc, we have to call an explicit “Refresh Hardware” function for each Host; and this logs an event, as you can see.

We do split the refresh calls over 6 intervals, by default. You can configure the interval ‘spread’.The setting is not available in our UI, but you can create this registry key on the nworks Collector(s) –
HKEY_LOCAL_MACHINE\SOFTWARE\nworks\VIC\Collector\GlobalSettings
(for 64-bit system, HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\nworks\VIC\Collector\GlobalSettings)
Create DWORD setting called ‘IntervalCount’ and set this to your required interval spread.

For example, if you had 24 ESX Hosts, and you set IntervalCount to 24, then one Host would be refreshed every interval (5 mins by default)
If you set IntervalCount to 12, then 2 Hosts would be refreshed every interval, and so on.

You can turn off the refresh hardware event completely – however I would not recommend that, as you would have no visibility of the hardware status of ESX servers.

I’d also recommend you don’t set the interval too large; as you will experience a delay in getting hardware alerts into SCOM.

Note the above change only affects Hardware Status alerts. Other aspects of VMware data (vCenter events, Host & VM performance metrics etc) is not affected.

There are more details in the Release Notes for nworks MP 5.0.3, found here http://www.veeam.com/files/release_note … _5.0.3.pdf

Hope the above answers your question – please let me know,

Regards

Alec King
Senior Product Manager
Veeam Software

Private Bytes Exceeded threshold – Management Server

WORKAROUND

To work around this problem, apply an override that applies to management servers to the Health Service Handle Count Threshold monitor and to the Health Service Private Bytes Threshold monitor. To do this, follow these steps:

1. Click Start, point to All Programs, click System Center Operations Manager 2007, and then click Operations Console.
2. In the Operations Console, click Authoring.
3. In the Authoring pane, expand Management Pack Objects, and then click Monitors.
4. On the Operations Console toolbar, click View, and then click Scope.
5. In the Scope Management Pack Objects by target(s) dialog box, click Clear All.
6. In the Look for box, type Health Service.
7. Click to select the Health Service check box, and then click OK.
8. In the Monitors pane, expand Health Service, expand Entity Health, expand Performance, expand Health Service Performance, right-click Health Service Handle Count Threshold, point to Overrides, point to Override the Monitor, and then click For a group.
9. In the Select Object dialog box, click to select the group named Management Server Computer Group, and then click OK
10. In the Override properties dialog box, check to select the Agent Performance Monitor Type – Threshold check box.
11. In the Override Setting field, change the value from 2000 to 10000, and then click OK.
12. Right-click Health Service Private Bytes Threshold, point to Overrides, point to Override the Monitor, and then click For a group
13. In the Select Object dialog box, click to select the group named Management Server Computer Group, and then click OK
14. In the Override properties dialog box, check to select the Agent Performance Monitor Type – Threshold check box.
15. In the Override Setting field, change the value from 104857600 to 1610612736, and then click OK

How to Put a Monitored Object into Maintenance Mode

To put a monitored object into maintenance mode

  1. Log on to the computer with an account that is a member of the Operations Manager Administrators role for the Operations Manager 2007 management group.
  2. In the Operations console, click the Monitoring button.
  3. In the Monitoring pane, expand Monitoring, and then click Computers.
  4. In the Computers pane, right-click the computer that you want to place into maintenance mode, click Maintenance Mode, and then click Start Maintenance Mode.
  5. In the Maintenance Mode Settings dialog box, under Apply to, click Selected objects only if only the computer is to be placed into maintenance mode; otherwise, click Selected objects and all their contained objects.
  6. Select Planned if this is a planned event; otherwise, leave it cleared.
  7. In the Category list, click the appropriate maintenance category.
  8. Under Duration, select and enter the Number of minutes or select and enter the Specific end time, and then click OK. A maintenance mode icon appears in the Computers pane, in the Maintenance Mode column for the computer you selected.