Welcome to MSDN Blogs Sign in | Join | Help

We recently released a set of PowerShell scripts for cross platform computers in Operations Manager, which you could use for migrating a computer to a new management group, script-based discovery, or to upgrade the agent (see “Cross Platform PowerShell Scripts Released”). These scripts are great because they allow you to do things with your Unix/Linux computers that might not be as easy to do as with Windows computers. The problem is that when you use the OpsMgr PowerShell environment and use the command “Get-Agent”, all it returns is the Windows managed computers. None of the Unix/Linux computers show up. This makes dealing with individual Unix/Linux computers more challenging, and it’s why these PowerShell scripts are so handy – because we did all the work for you.

In my own testing I had a need for being able to quickly reset my system and remove all the Linux computers from the management group. For my own purposes, I could just hit delete a few times and be done with it – not much effort. Then, a few days ago, a customer wrote in and said they have 100+ Linux machines in their console and they’d like to delete them, and wondered if we had any PowerShell script to do that. Well, we didn’t, but using the existing PowerShell scripts we already released, I was able to quickly write up a script that used existing functions in the released scripts and then added the functionality of finding all the computers under Microsoft.Unix.Computer (the master class for all Unix and Linux computers) and then removing all of them from the management group.

IMPORTANT:

Running any script against a production Operations Manager server is dangerous! You should always test every script in a non-production environment to ensure it will work correctly in your specific situation. I have only done minimal testing in a limited environment that probably doesn’t come close to your own environment’s configuration.

Neither I nor Microsoft, nor any other person, animal, vegetable or mineral assumes responsibility for the script demonstrated here.

USE AT YOUR OWN RISK!

 

Ok, so here’s the setup. The code below is PowerShell. Copy & paste it to a file called RemoveAllUnixComputers.ps1 (you can name it anything you want but I think this name clarifies its purpose).

##########################################################################################
# <copyright file="RemoveAllUnixComputers.ps1" company="Microsoft">
#     Copyright (c) Microsoft Corporation.  All rights reserved.
# </copyright>
# <summary>Looks for all Unix computers and removes them from OpsMgr</summary>
##########################################################################################

param([switch]$help)

begin {
    Set-PSDebug -Strict
    . C:\Files\PowerShell\scx.ps1
    function ProcessComputers()
    {
        $localhost = GetComputerName
        if ($localhost -eq $null)
        {
            return LogStatus "Unable to get name of local computer"
        }
        Write-Host ("`n Local computer name: ${localhost}")
        $ms = Get-ManagementServer
        if ($ms -eq $null)
            {
                return LogStatus "Unable to get management server"
            }
        Write-Host ("`n Management server: $ms.HostComputer}")
        $mg = GetManagementGroup($ms.HostComputer)
        if ($mg -eq $null)
        {
            return LogStatus "Unable to get management group"
        }
        Write-Host ("`n Management group: ${mg}")
        $mc = Get-MonitoringClass -Name "Microsoft.Unix.Computer"
        if ($mc -eq $null)
        {
            return LogStatus "Unable to get monitoring class Microsoft.Unix.Computer"
        }
        Write-Host ("`n Monitoring class: ${mc}")
        $mo = Get-MonitoringObject -MonitoringClass $mc
        if ($mo -eq $null)
        {
            return LogStatus "Unable to get monitoring object(s) for class Microsoft.Unix.Computer"
        }
        Write-Host ("`n Monitoring object(s): ${mo}")
        foreach ($computer in $mo)
        {
            Write-Host "`n Now processing ${computer}"
            $discoveryData.Remove($computer)
            Write-Host ("`n`n ##  Removed ${computer}")
            # Get the connector
            $connector = $mg.GetConnectorFrameworkAdministration().GetMonitoringConnectors() | where {$_.Name -eq 'Unix Computer Connector'}
            # Push it in via specified connector object
            $discoveryData.Commit($connector)
            Write-Host "`n`n ##  Committed."
        }
        Write-Host ("`n Done removing computers ")
    }
    # Print help text.
    if ($Help)
    {
    Write-Host @"

RemoveAllUnixComputers.ps1

Removes all Unix/Linux computers from a management server.

Input:
  None.

Output:
  None.

Parameters:
  help               - Prints this help

"@
    exit
    }

    Load-Assembly("Microsoft.EnterpriseManagement.OperationsManager")

}

process {
    ProcessComputers
}

end {

}


Note that this script calls the scx.ps1 script. This is to provide some basic functions, load the appropriate OpsMgr assemblies, and other things. This script should be modified to point to the correct location of the scx.ps1 scipt..

This is what was in my OpsMgr console before I ran the script:

image

To run the script, you’ll need to start a PowerShell shell, so go to Start > All Programs > System Center Operations Manager 2007 R2 > Operations Manager Shell. When the window opens, just type in the path and filename of the script and hit Enter. Don’t CD to the directory because then you’ll lose the connection to the provider for the management interface. Here’s what you see when you run it.

image

And when I refresh my OpsMgr console, the Linux computers are gone!

image

 

Happy scripting!

Recently I was doing some tests and was trying to deploy a new Linux computer to be managed by Operations Manager. The discovery wizard kept failing with “unspecified error”. That’s really helpful, right? Well, I did what I normally do when i have any kind of discovery problem – I started DebugView to watch what was going on behind the scenes during the discovery. It didn’t end up being very helpful either, though it did show where the process was failing. Here’s what DebugView was showing me:

Beginning ExecuteOSInformationScript on thread id: 10    
10| Executing DiscoveryScript.Discovery.Task    
10| Returned from DiscoveryScript.Discovery.Task    
10| DiscoveryScript.Discovery.Task returned as succeeded    
10| Return from DiscoveryTaskHelper.ExecuteOSInformationScript()     
Return from DiscoveryTaskHelper.ExecuteSSHDiscovery()     
Microsoft.MOM.UI.Console.exe Error: 0 :     
10.10.10.15: ExecuteSSHDiscovery failed with exception: <stdout></stdout><stderr></stderr><exception>Unspecified problem</exception> 

 

So my discovery was failing after deploying the discovery script to the computer. I still didn’t have enough info to figure out the problem, so I looked at the debug logging for the SCX modules.

Handy Tip:   (from Cross-Platform Logging Methods on TechNet)

You can enable debug logging of the SCX modules on the OpsMgr server by going to the C:\Windows\Temp directory and creating a blank file named EnableOpsMgrModuleLogging (no extension). This will enable the creation of several new log files in the same directory:

  • DeployFile.vbs.log
  • SCXCertWriteAction.log
  • SCXLogModule.log
  • SCXNameResolverProbe.log
  • SSHCommandProbe.log
  • SSHCommandWriteAction.log

Utilizing the DeployFile.vbs.log and the SSHCommandProbe.log files, I could see a little more detail into what was happening. Here’s what the logs showed:

Transferring file: C:\Program Files\System Center Operations Manager 2007\AgentManagement\UnixAgents\scx-1.0.4-252.centos.5.x86_64.rpm to location: /tmp/scx-root/
Verifying that file: scx-1.0.4-252.centos.5.x86_64.rpm was transferred properly
/tmp/scx-root/scx-1.0.4-252.centos.5.x86_64.rpm

SSHCommandProbe::DoProcess preparing SSH call
22
root
sh /tmp/scx-$USER/GetOSVersion.sh; EC=$?; rm -rf /tmp/scx-$USER; exit $EC
Enter SSHFacade::RunCommand
ExpectedSSHFacadeException
Unspecified problem

So this told me the file was getting transferred (so not indicating problems with SSH) but when it was being run, there was no output. Hmmm. I’m still no further to finding the answer. I logged on to the Linux computer locally and ran the GetOSVersion.sh script using the same command line as above, and got a 0 return code and the appropriate XML. That’s weird. The script works fine, OpsMgr can connect to the Linux computer via SSH, it can drop the file there and run it, but nothing comes back.

Next I get out WinSCP to manually transfer the agent over there, and in opening up an SSH connection, WinSCP actually times out. This is interesting since both of these are VMs running on the same host, sharing the same networks. Now I realized that both the OpsMgr VM and the Linux VM have two network connections. One to my corporate network (so I have Internet connectivity) and one to a private 10.x network. Perhaps there are issues with the network connections not figuring out where the communication should go? I disabled my corporate network connections on both VMs, leaving only my private 10.x network on each. Magically, WinSCP connects instantly. It couldn’t be this simple could it? Well if you read the title of this article, you already know the answer to that. :)

Disabling the multiple network connections and keeping the single subnet active enabled the discovery to occur without a problem. And, only now did I realize that when both networks were active, discovery was taking a really long time. I did notice it at the time and wondered why it was taking so long, but I didn’t really link the issue until I saw how fast discovery was with the single network. Now I know that you can’t just go disabling NICs in a production system – they’re there for a reason. But what you can do is see if there are any conflicts with DNS, gateways, or other issues that might slow down the communication process to the point the discovery process times out on getting things done. The tell-tale signs are a really slow discovery (it shouldn’t take more than 30-45 seconds to get back the initial discovery data).

Hopefully my pain is your gain and this will be helpful to those having issues!

This question comes up often enough, and I saw another person send an email out on it today – “How is Operations Manager licensed when it comes to monitoring UNIX and Linux computers?” For some reason, people think that because a monitored computer is running UNIX or Linux that the process must be different. Our licensing process is complicated enough without adding in different rules for UNIX and Linux computers! :)

So here’s the simple answer: Operations Manager is licensed according to the workload, and there are two license types – Standard Server ML and Enterprise Server ML. The workload you’re managing with a management pack determines the license type needed.

For Standard Server ML:

  • Management of basic workloads:
    • Base OS or system hardware
    • Storage/File/Print (FTP, NFS, SMB and CIFS)
    • Networking (DHCP, DNS, WINS and RADIUS)

For the Enterprise Server ML:

  • Any functionality not covered by the Standard Server ML (including application management)

I recently saw a bug submitted to our team about CPU usage statistics being reported by the cross platform agents and MP. The explanation from the customer was that our performance numbers weren’t the same as what they were seeing in tools like vmstat and mpstat and it was a bit confusing. It seemed like our CPU calculations were just wrong. In this article, I’ll discuss how the calculations are made and why the performance numbers might not match up to some other tools.

First of all, it’s important to understand how the agent gathers the data and how it gets to the OpsMgr server. The agent doesn’t gather the data every second – to do so would put an undue burden on the system just to monitor things burdening the system (recursive monitoring?). The agent collects the performance data once every 60 seconds. It’s a snapshot of what is occurring in that split second when it captured the data, just like if you looked at the current temperature outside. You know what it is now, but not what it has been during the day. This snapshot of data is then combined with the previous four snapshots and averaged into a rolling five-minute window of performance. This window shows the average CPU utilization over the previous five minutes and goes up and down with each 60-second data collection interval. Based on how often your OpsMgr server polls the agent for data (for CPU utilization the interval is 5 minutes), you will see some point along that trend line. The confusion occurs when people think the data they see in the monitor is real-time or actual data, when what they are actually seeing is this rolling average.

To demonstrate how this works, let me show you a graph of hypothetical CPU data:

This first chart shows some CPU utilization over a period of 11 minutes.

image

Next, we’ll overlay the values taken at the sampling interval (at the top of every minute), shown in green. Note that the performance data from the sampling is not the same as the overall CPU utilization – it only matches at the one-minute intervals. If a spike happens between the collection intervals but then returns to normal when the interval hits, you won’t see the spike. This filters out some of the noise of the ups and downs.

image

Next, we’ll overlay the rolling 5-minute average, which is essentially a trend line. Note that it is drastically different than the other values. This further smoothes out the data, and I’ll explain later how all this makes sense for the admin.

image 

This next chart shows what the actual values will be when the data is collected from the agent at its 5-minute interval. The data points occur at minutes 0, 5 and 10. I put a dashed line between them just so you can see the trending. When viewing the performance data in the Operations Manager “Processor Performance” view, OpsMgr will “connect the dots” and show you the trend line.

image

Just looking at the chart above, you might begin to think that CPU utilization is always underestimated by this rolling average, but it’s not. You’ll note at the end of the chart that the red average line is going upward and will meet the other two lines (possibly at the next interval).

The thing about this rolling average is that it smoothes out the spikes in load values to show what is true utilization. We all know that when apps start or perform some operation that it’s going to use more CPU than when it’s just sitting there. What every admin wants to know is how much their server is being utilized on average so that when average utilization gets too high they can plan on making resource modifications. Spikes aren’t that worrisome because the system generally absorbs those spikes and it doesn’t affect the users to any great degree. It’s when average utilization gets high that every spike becomes a problem for users. By using this rolling average for calculating utilization, you also avoid getting lots of “noise” type alerts from OpsMgr. Let’s face it, you really don’t want to have alerts hitting you every time the CPU hits full utilization – you want to know when it’s been at full utilization for some time. This rolling average gives you that.

I know what you’re saying… if having an average utilization is good, why not just have total average utilization? The reason is that this rolling 5-minute window gives the performance data “more responsiveness”. By that I mean that it can show fluctuation more rapidly than an ongoing average of all data. Here’s one last chart to demonstrate this point. I’ve plotted the 5-minute average of the 1-minute samples in red and an ongoing average of all samples in blue:

image

For this example, I estimated that the CPU utilization was a constant 10% for the previous 10 minutes and that the continuous averaging method only went back to the previous 10 minutes. This means the chart shows a total of 20 minutes of averaged activity. The biggest thing you notice about these two lines is that the constant average line is very steady. It doesn’t move up or down very fast. The red line, showing the 5-minute average, moves up a lot in a couple of places. The benefit here is that while smoothing out the data, the 5-minute average can still give you evidence of high utilization without having to be sustained for a long time. It takes a lot more for the blue line to move up or down, which means that the reaction time to major issues could be a lot longer. If your CPU was at 10% utilization for a long period of time and suddenly went to 100%, You’d see it right away with the 5-minute average, but the continuous average would take a lot longer.

I hope this article clears up a little mystery surrounding CPU performance data. I’ll be writing a lot more of these types of articles in the future.

I hear this same question over and over in the forums, email discussions and face to face with lots of different groups: “How do I convince the Linux admins in the company to work with us on implementing Operations Manager to monitor the Linux machines too? From a cost savings and compliance perspective, having a single management infrastructure is definitely a benefit to everyone involved. You only have “one pane of glass” to look through to see how your entire IT infrastructure is operating, whether it’s Windows, Linux or UNIX. This is the benefit of Operations Manager R2’s cross platform support for UNIX and Linux platforms. The problem is that there’s an inherent protectionism among Linux admins that puts up an invisible force field around the Linux servers so that “the Windows guys” don’t touch them. It’s not that the Linux guys are just being angry, spiteful admins – they just want to protect the machines they’re responsible for, and face it Windows guys, you just don’t know a lot about running a Linux server. Now it’s true that the Linux guys probably don’t eat lunch with the Windows guys, and they don’t pal around together after work, but they don’t hate you. Honest, they don’t.

When I started working on server deployment tools for HP about 10 years ago, we started talking about automating network switch configuration along with server deployment. Back then, it was the same thing…”How do I get the network guys to trust this tool? They have their own tools and don’t want some outside deployment process to go messing up the network.” The push-back was the same then as it is now, but I believe that the differences between Linux and Windows server management are much smaller than between server and network management differences. We all want to monitor the same things – overall system health, performance, disk space, utilization. The difference is the commands used and the location of information. Fundamentally, server management is server management, regardless of the OS. The only difference is in the fine details.

Ok, so how do I answer the question? How do I get the Linux guys to accept using Operations Manager as the default management tool? It has to be a top-down and a bottom-up approach. From the top down, management in the company has to issue an edict that there will be a single management infrastructure. They know this will save money, save admin resources, and make the overall health of the company’s infrastructure better, because everything will be transparent, through “one pane of glass”, and resources will be used to build and extend additions to that management infrastructure just once, not once for each management infrastructure in place. From the bottom up, you have to involve the Linux guys in planning and architecture. Have them provide an analysis of their current Linux tools versus the System Center capabilities, and feel free to say if there are things that their current tools do better. The goal here is getting everything out in the open. Once that happens, you can discuss how to extend or modify the System Center tools to suit the needs of Linux management. Many times, they’ll end up with something much better than what they had before.

One thing that always appeals to the Linux guys is when products are open source. Linux admins want to know that things aren’t hidden under the covers, and that if they want to change the way something works, they can (but most likely won’t) go modify code and make it act the way they want. The cross platform solutions for Operations Manager 2007 R2 leverage open source and open standards. We utilize OpenPegasus as the CIM server, which is completely open source. We’ve even submitted enhancements back to the Open Group to include in OpenPegasus 2.10 coming out next month. We also provide the source code for our CIM providers on our site on CodePlex and we’re also starting to build a community extensions project as well.

Aside from the purely social or political aspect of the issue, we can also address the technical side. Many times Linux admins object to the requirement that root privileges are required to run the agent and the CIM server, and also object to yet another agent on their machines. I’ve discussed root privilege requirements before, but suffice it to say that root requirements are nothing new. OpenPegasus itself requires root, the PAM requires root to authenticate other users, some kernel APIs require root in order to collect the performance / monitoring data needed, and the agent needs to impersonate other users (like when a low privilege user runs a command, a process is spawned as that user). All of these things that are relatively normal in monitoring require that we have root level access. That said, we are working to enable sudo access in more situations in the next release.

If the remaining objection is that they can’t use a Linux/UNIX-based tool to monitor these machines, we can also point them to our connector solutions for HP OVO, Tivoli, or even the universal connector that will let them share data with virtually anything.

More often than not, objections from teams in implementing anything new are caused by (1) fear of the unknown – they know their system and don’t want change, and (2) anger at not being involved in the decision-making – being told by “the Windows guys” that they will implement something and they don’t have a say. It’s too easy to get put into camps of IT administration with Windows on one side and Linux on the other. Let’s build some bridges and get people communicating! Above all, let’s be more efficient by working on a management system that crosses the boundaries between the different platforms.

In part 1 of this article, I talked about the basics of building a CentOS Management Pack, beginning with trying out the Red Hat agent. In part 2, I talked about how to build the actual MPs. Now I need to actually install the MPs and make sure it all works.

Importing the Management Packs

To import the MPs:

  1. Go to the OpsMgr console and from the Administration pane on the left, right-click on Management Packs and select Import Management Packs.
    image
  2. Click Add > Add from Disk and then click on No at the Online Catalog Connection prompt.
  3. Select the library MP file (not the XML file) and the CentOS.5 XML file, and click OK.
    image
  4. You’ll see the two MPs in the list for import. Click Install. The MPs begin importing and each will show status of Imported when done.
    image
  5. Click Close to exit the wizard.

Deploying the Agent

II made sure I uninstalled the SCX agent from my test machine (using “rpm –e scx”) so that I could test agent deployment, which would now be automated. Just to be absolutely sure it would be a clean install, I made sure all “microsoft” directories were removed from /opt, and /etc/opt (which also removed the certificate). I also deleted the computer from OpsMgr.

Now we need to go through discovery and deployment of the agent. Right-click inside the Administration pane in OpsMgr and select Discovery Wizard. Select Unix/Linux computers and click Next. Click Add, enter the appropriate information for the remote computer, and enter root-level credentials. Click OK when done to save the entry.

image

Note: Make sure Enable SSH based discovery is checked or you’ll have to manually install the agent.

Click Discover. The discovery process starts and when complete, you should see something similar to this:

image

Note that it shows the operating system as CentOS. This means that the discovery in the MP we imported worked successfully. However, it’s set to “No Action” and if I click Details, the dialog states that this is an unsupported platform.

It just so happened that I was running the DebugView utility during my discovery, which allowed me to see some deeper information about what was going on. Looking at the output, I see the following:

Return from DiscoveryTaskHelper.GetSupportedAgentInfo()
Microsoft.MOM.UI.Console.exe Error: 0 :
10.10.10.15: Did not find a matching supported agent.

The issue is that when the discovery runs, it returns information from the computer telling it the OS, architecture and other information. This information is matched against the MP’s discovery info, and then an agent file name is built from the settings information. If the agent file is not found in the AgentManagement\UnixAgents directory under OpsMgr’s installation directory, then this error occurs.

Here’s the XML that the discovery script returns to the Management Server:

<DiscoveredOS>
<Hostname>myhost.microsoft.com</Hostname>
<OSName>CentOS</OSName>
<OSAlias>CentOS</OSAlias>
<Version>5.4</Version>
<Arch>x86_64</Arch>
<IsLinux>true</IsLinux>
</DiscoveredOS>

These values are mapped to the MP’s discovery settings like this:

  • OSAlias -> OS
  • Version -> MinVersion (only the major version is compared)
  • Arch -> Arch

Going back to the first part of this article, I see that the Red Hat agent files begin with “scx-1.0.4-252.rhel.5". So, I find the two files (one for x86 and one for x64) and create copies of them, and then rename the copies to the following:

  • scx-1.0.4-252.centos.5.i386.rpm
  • scx-1.0.4-252.centos.5.x86_64.rpm

This corresponds to the following properties in the Discovery Settings:

Property Name

Value in MP

Value in agent file name

Comparison

Version

1.0.3

1.0.4

If version of agent file is => this version, it can be used

Build

106

252

If build of agent file is => this build #, it can be used

OS

CentOS

CentOS

Must be equal

KitOSVersion

5

5

Must be equal

ArchKitName

x86_64

x86_64

Must be equal

Ext

rpm

rpm

Must be equal

After creating these files, I restarted the System Center Management and System Center Management Configuration services to make sure that everything was reloaded and not cached, or the discovery could fail again because OpsMgr didn’t know about the changes. After going back through the Discovery Wizard, I can see the output changed. The Action now shows as “Install Agent and Discover” and clicking on the Details button displays the message “Install agent and discover computer instance into Operations Manager.”

image

I can now select the checkbox next to the computer and the Next button is enabled. Click Next to start the deployment process. The Status field on the wizard will update as different actions occur.

image

If everything was successful, the status will display as such, and you can now click Done to end the process. If things didn’t work (probably a certificate error), then you can troubleshoot that and try again.

Monitoring the CentOS Computers

Now that a CentOS computer has been discovered, new things appear in the console. If you go to the Monitoring pane of OpsMgr, then drill down to Unix/Linux Servers->Linux, you’ll see a new CentOS Computers Diagram. You should see something like this:

image

Unfortunately, because of the standard Red Hat discoveries’ configuration, you will also see this under the Red Hat Computers Diagram.

image

We can take care of this issue a little later. First we need to make sure everything is working as expected. Right-click on the CentOS computer and select Health Explorer. This opens the Health Explorer for that computer, and you should see something similar to this:

 image

You’ll notice that some monitors are clear, and some monitors show green checkmarks even though there’s not any state change events for that monitor. This is not abnormal, but this bears some further investigation.

First, we want to make sure that all the discoveries and monitors are enabled. This is the only way to test that they work. The easiest way to check this in the console is to go to Authoring > Management Pack Objects > Object Discoveries. Click on Change Scope at the top right to filter everything just to what we need, which is the CentOS objects. Just type in CentOS in the Look for box, then click Select All, then OK.

image

From this list, you can see that two discoveries, Physical Disk and Processor, are not enabled by default (the same as the default Red Hat MP).

image

To enable these, just right-click on them and select Enable. Looking at all the Monitors and Rules, it appears that they are all enabled by default, so no changes needed here.

There are also the potential requirements for all the discoveries to actually fire. By default, some discoveries may take hours before they fire again, so you rely on cookdown for some stuff, and a repeat fire for other stuff. Just to make sure my discoveries are firing again instead of waiting for some potentially long timeout period, I restart the services again. Here is what I end up with:

image image

So far so good… it now looks like I have status monitoring for everything except Application/Service Availability, Availability - Processor0, Performance – eth1, and Security. Everything else is now showing a green checkmark. Assuming these are not just timing issues, let’s go investigate.

Looking back in Authoring -> Management Pack Objects -> Monitors, I can see that in the CentOS Linux 5 Processor group, there isn’t any monitor configured for the Availability category. So that makes sense that there’s no monitor status for that in the Health Explorer. It looks like the same is true for Performance under CentOS 5 Linux Network Adapter and Security under CentOS 5 Linux Computer.

So, it looks like we’re getting monitoring information for all the things we should be getting monitoring for. The next thing to do is to test that when things aren’t working, that the monitors change state, and that the diagnostics and recoveries work as expected. In the next installment of this article, I’ll go through testing the functionality of the Management Pack to make sure all the monitors, diagnostics and remediations are working correctly.

In part 1 of this article, I talked about the basics of building a CentOS Management Pack, beginning with trying out the Red Hat agent. Now I’ll continue the article where I left off, talking about building the MP itself.

Creating the Management Pack

In order to replicate everything I did, it helps to understand a bit of the process surrounding the cross platform management capabilities in Operations Manager 2007 R2. First of all, there’s the schema, or organization, of the libraries and management classes related to UNIX and Linux. Here is a section of the schema chart for the classes for Red Hat related to the System.LogicalHardware class:

image

You’ll notice that there are several levels that drill down into further and further detail: UNIX - > Linux -> Red Hat -> RHEL 5. Each lower level derives from and adds greater detail to the more common properties of the one above. This is a basic concept of Operations Manager (hey, I said I was new to this, so bear with me).

After I wrote the last article “Using OpsMgr Class Inheritance to Extend Monitoring to New (Unsupported) Operating Systems” I thought about going a different direction in creating this MP than I was going to do originally. I thought about using overrides and inheritance to extend the RHEL.5 MP for CentOS, but in the end I decided to stick with the “copy, search and replace” method. The reason was the same one we have for creating virtually identical RHEL4 and RHEL5 MPs – because if anything changes in the base, it could break the derivative if the derivative didn’t need to change.

So what I’m going to demonstrate here is taking the existing Red Hat Library and the Red Hat 5 Management Pack and then creating new MPs to support CentOS 5. The graphic below sort of demonstrates how these new MPs will fit into the hierarchy.

image

Creating the CentOS MP XML Files

The first thing I need to do is to get copies of the Red Hat Library and Red Hat 5 MPs. Since these MPs are sealed, I need to export them into XML format so that I can see what needs to be changed. To do this, I got the MpToXml.ps1 PowerShell script for converting sealed MPs to XML from the OpsMgr++ Blog here: Converting a sealed management pack to readable XML. This PowerShell script really only does two things (using the public OpsMgr SDK): creates a management pack object from the MP specified, and then writes it out to XML.


Note: I am using the MPs with a version number of 6.1.7000.269, available as part of the cross platform update dated December 17, 2009, available for download here: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=b15fef5c-e331-4006-8913-be376bb0e0c1 or from the MP catalog accessible from within the OpsMgr console.

I ran the script to export the MPs (RHEL.5 shown below):

image

I copied these files to a new location and renamed them Microsoft.Linux.CentOS.Library.xml and Microsoft.Linux.CentOS.5.xml. I opened these files and did a search and replace on the following strings (you should do them in this order):

 

Original Text

Replacement Text

Library XML file

CentOS.5 XML file

RHEL

CentOS

 

X

x86

i386

 

X

x64

x86_64

 

X

RedHat

CentOS

 

X

Red Hat

CentOS

X

X

Enterprise Linux Server

Linux

X

X

Root XML Element Changes

Because the XML comes from a sealed MP, the “ManagementPack” element in the XML includes a “RevisionId” attribute, and the “ContentReadable” attribute is set to “false”. And, since our new CentOS MP is not sealed, this needs to be changed. Just remove the “RevisionId” attribute and its setting, and set “ContentReadable” to “true”, as the example shows below:

<ManagementPack xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsl
="http://www.w3.org/1999/XSL/Transform" ContentReadable="true">

Identity Element Changes

Just like the above, a sealed MP has a PublicKeyToken value inside the Identity element. Because this MP is not sealed (yet), this element needs to be removed. Just remove the whole element and its contents as shown below:

In the Library file:

<Identity>
<ID> Microsoft.Linux.CentOS.Library</ID>
<Version>6.1.7000.256</Version>
</Identity>

In the CentOS.5 file:

<Identity>
<ID> Microsoft.Linux.CentOS.5</ID>
<Version>6.1.7000.256</Version>
</Identity>

Next, there are specific changes for the individual files.

Changes to the Library XML File

Computer Discovery Changes

While it’s true that CentOS is a derivative of Red Hat, and as you saw in the first part of this article, the Red Hat agent works on CentOS, unless we change something in the discovery to distinguish a CentOS computer from a Red Hat computer, OpsMgr won’t know which is which.

If we look back at the output from the command to scxcimcli enumerating the SCX_OperatingSystem class, then compare that to the same output from a Red Hat computer, the “Name” property of both is “Red Hat Distribution”. However, looking at the “Caption” property, the CentOS computer has a value of “CentOS release 5.4 (Final). This is what we’ll have to use to distinguish the two computer types.

To make this change, look for the Monitoring -> Discoveries -> Discovery element with an ID of “Microsoft.Linux.CentOS.Computer.Discovery”. Now just change the values of the FilterProperty and FilterValue elements in the XML to the values shown below:


<FilterProperty> //*[local-name()="Caption"] </FilterProperty>
<FilterValue> CentOS </FilterValue>

There’s one more change needed in this discovery to make it work. We could have put the exact OS version string in the FilterValue property (“CentOS release 5.4 (Final)”), but that would make it fixed to that specific build, and since this is a general CentOS library, we want it to work with any version. The version-specific MP should have that information in it, not this one. So what I did was I just put the beginning of the string there (enough to distinguish that it’s CentOS). However, if you look at the DataSource element below, it’s using an “Equal” comparison, so a partial match is not a match. This needs to be changed to “ContainSubstring” so we can do the partial comparison:

The original element text:

<DataSource ID="DS" TypeID="Unix!Microsoft.Unix.WSMan.TimedEnumerate.Filtered.Equal.DiscoveryData">

The modified element text:

<DataSource ID="DS" TypeID="Unix!Microsoft.Unix.WSMan.TimedEnumerate.Filtered.ContainSubstring.DiscoveryData">

We’re done editing the library XML, so save the file and close it.

MP Sealing Requirements

Since I mentioned the previous MPs were sealed, now is a good time to talk about sealing requirements. Any time an MP references or extends another MP, the base MP must be sealed. This means that if I want to replicate the OS Library -> OS Version structure of Red Hat’s MP, I have to seal the new CentOS Library MP in order for the CentOS 5 MP to extend it.

In order to seal an MP you will need a key file, which is a strong name key ending with an extension of “.snk”. You can create a key using the Strong Name Tool, and use it for signing any of your custom MPs.

Handy Tip: You can create the key file using the following command line:

sn.exe –k key.snk

Once you have the key file, the easiest way to seal an MP (and check it for issues in the process) is to use the Operations Manager Authoring Console. Open the XML file for the Library (you may need to locate the UNIX and Linux Library MPs as well). Verify the MP is structured correctly by selecting Tools > Verify, and you should get a success notification like the one below:

image

Next, select File > Save As > Sealed and Signed Management pack from the menu. The file should automatically be named Microsoft.Linux.CentOS.Library.mp. Click Save. Enter appropriate values for Company name and Copyright, and click the button on the right to browse to your key file created above.

image

Click OK. A new .mp file is created in the target directory.

 

Changes to the CentOS.5 XML file

Reference Changes

This XML references the CentOS.Library MP because it extends that MP. However, the PublicKeyToken value for this reference needs to be changed to point to the specific value from the sealed MP you just created. Since this was a cut and paste, the current value points to the Red Hat MP value. You can get the value for this by using the sn.exe utility again with the following command line:


sn.exe –T Microsoft.Linux.CentOS.Library.mp

The utility will display something similar to the following (your PublicKeyToken value will be different):

image

Now take this value and replace the current value in the XML, similar to the following:


<Reference Alias="CentOS">
<ID>Microsoft.Linux.CentOS.Library</ID>
<Version>6.1.7000.256</Version>
<PublicKeyToken>7542ab621f15245f</PublicKeyToken>
</Reference>

Computer Discovery Changes

Just like the Library MP, the CentOS.5 MP needs to change what it’s looking for to classify the discovered system as a CentOS 5 computer. To make this change, look for the Monitoring -> Discoveries -> Discovery element with an ID of “Microsoft.Linux.CentOS.5.Computer.Discovery”. Now just change the value of the FilterValue element (since it already uses the “Caption” property”) in the XML as shown below:


<FilterValue> CentOS </FilterValue>

The same change needs to be made to the Microsoft.Linux.CentOS.5.OperatingSystem.Discovery element contents.

So now we have a library MP file (signed and sealed) and a CentOS.5 MP file (still in XML format) that references the library. The next step is to import the MPs into OpsMgr and use them. I’ll cover that in the next installment of the article.

A couple of weeks ago, I posted “Privileged and Non-Privileged “Run As” accounts in cross platform monitoring”, which was a brief article giving an overview of Run As accounts for OpsMgr Cross Platform. I ended up writing a long post in the forum about this, since it’s a common question and not documented very well. I thought I’d also write another article about this and not only provide what I said in the forum post, but a couple of other tidbits as well…

Run As Profiles

First of all there's the topic of the two Run As Profiles - the "Unix Action Account" and the "Unix Privileged Account". Each of these profiles needs to be configured and must contain at least one user account to function. They can both use the same account, or they can use different accounts. The Unix Privileged Account must be root if you want all of the rules, diagnostics and recoveries to function. The agent does not currently support sudo accounts. For diagnostics and recoveries, it's possible to override the command used (something like "<p:command>sudo sh -c 'ps -ef | grep syslog | grep -v grep'</p:command>", but sudo passwords cannot be used. The Unix Privileged Account profile is used for certain actions that require root-level privileges to perform. These include some rules, some diagnostics, and most recoveries.   

You can find out which monitors, diagnostics or recoveries require which account profile by looking at the management packs (you could use either the Authoring Console to look at the sealed MP or you can access the XML from the Health Service State\Management Packs directory and view it in an XML editor). Just look for things like "Invoke.Privileged.ProbeAction" (compared to the normal "Invoke.ProbeAction"). There's also "Invoke.Privileged.WriteAction" and "SCXLog.Priviledged.DataSource".

Root Account Requirements for the Agent

Next is the topic of why a root account is needed to install the agent, and why the agent runs in root context. Basically, the Linux/UNIX kernel requires root-level privileges in order to access the data counters that the agent uses and reports on. Many of the classes used are read only and we allow them to be queries with a non-privileged account. For classes that also allow write operations (like ExecuteCommand()), the agent runs the command using the credentials of the Run As account. Since only root can spawn processes as other users, the agent requires root context to run. Other processes like the logfile scanning provider use the Run As account to instantiate the provider process to make sure privileged files can only be read by privileged users.

Agent Background Activities


Finally, the answer to "just what is the agent doing in the background when not asked to provide monitor data to OpsMgr?"... The agent is performing collection of performance data in a separate thread. For the delta counters (CPU load, Disk IO, etc.), data is kept in a rolling window, and when OpsMgr asks for it, an average value is returned. There is very little cost in querying the agent for the data, since the data had already been collected. The data sampling interval has been optimized for the OpsMgr-> agent communication interval to reduce load.

Hope this helps.

I got an email the other day from a customer who asked if we were planning on supporting Red Hat desktop anytime soon. It seems that they’ve installed the desktop versions on their servers instead of the server versions, and since the Management Packs included with Operations Manager R2 support only Red Hat Enterprise Linux (RHEL), and are geared to discovering that specific OS, their desktop systems won’t get discovered properly. It seems the agents get pushed out and installed properly, but none of the discoveries are working, so the machine sites there not being monitored.

Well, since I was already working on my other article on porting a Red Hat MP to work for CentOS, I thought it was an opportune time to see if I could generate a quick MP extension to make this work. I thought that the real problem was that the initial computer and OS discoveries were not working (because it was RHED instead of RHEL), but all the other monitors, rules, diagnostics and recoveries should be exactly the same. So, I worked on a hunch that if I could get OpsMgr to discover these systems and then act like they were actually RHEL machines (discover them using the RHEL classes), everything would work. My hunch worked, and the systems began getting discovered properly, so I thought I’d share the MP I created.

Differences between RHED and RHEL

The main differences between the discoveries that the RHEL MP performs and what the RHED OS provides are small. When you look at the computer discovery in the RHEL MP (OS discovery is the same), you can see that it’s looking for a specific value in the “Caption” property:

<FilterProperty>//*[local-name()="Caption"]</FilterProperty>
<FilterValue>Red Hat Enterprise Linux Server release 5</FilterValue>

In order for this to work with the desktop OS, it needs to be changed to this:

<FilterProperty>//*[local-name()="Caption"]</FilterProperty>
<FilterValue>Red Hat Enterprise Linux Client release 5</FilterValue>

Making this into an MP

Ok, so now that we know these differences, how can we make this into an MP that enables monitoring these machines? The key is in taking these new discoveries and making them apply to the existing targets and discovery classes. For the Operating System discovery, the existing RHEL MP has the Targets and DiscoveryClasses shown below:

image

This means that when the computer matches the “Caption” property filter, a RHEL.5.Computer object is created, and that this class belongs to the Linux.RedHat.Computer object.

image

This means that when the computer matches the “Caption” property filter, a RHEL.5.OperatingSystem object is created, belonging to the RHEL.5.Computer object created above.

 

So, if we want to take our RHED discoveries and make them discover as RHEL machines, all we have to do is give our new discoveries a Target and DiscoveryClass the same as the RHEL MP. The resulting XML looks like this:

image

image

 

The only other things that need to be done for this MP are to define the ClassTypes (which are really just definitions for the abbreviations used for targets), and to specify the other MPs that this MP will reference. Here’s how that looks:

image

The result is that one you import this Management Pack, any Red Hat Desktop systems you have in your environment will look exactly like RHEL systems! This technique is useful when you have other Linux versions or distros that don’t match the supported platforms list but where the agent installs just fine and all you care about is that the systems are monitored. Of course, if you actually want to have RHED systems show up as RHED instead of RHEL, you’ll have to do a lot more than this. You'll probably want to replicate a lot more of the MP and make other changes, but instead of referencing the RHEL classes, you’ll be making new RHED classes so those new object types will appear in OpsMgr.

The sample XML file from this article is attached below. Good luck!

0 Comments
Filed under: , ,

Attachment(s): RHED5.xml

 

As part of my learning process in joining the Cross Platform & Interop team (some might call it hazing!), I recently built my first-ever Operations Manager Management Pack. It wasn’t exactly a “Hello World” MP (I built a CentOS MP) but those that know me would say that’s typical of me. I like to dive down and get going when I discover new things. Given that CentOS is a derivative of the Red Hat distro, it wasn’t really difficult to build, but it took some understanding of the discovery mechanisms and how Linux agents are deployed and installed. Much thanks goes to Barry Shilmover for the assistance to the new guy! My goal in this article is to describe the process I went through and provide enough detail and background info so you could take this and not only create your own CentOS MP (which you really don’t need to do since I will include the XML), but take the knowledge you get here and apply it to other distributions and create MPs for distros like Oracle Enterprise Linux (another Red Hat derivative) or just new versions of existing supported platforms.

Note from the legal dept: The CentOS management pack described here, and other MPs created using this process, are not officially supported by Microsoft and are provided only as examples and community samples.

Acknowledgement: Though I built this MP from start to finish on my own, learning the hard way about a number of different potential pitfalls, I’d like to give credit to Dan Muscetta who actually did a Red Hat to CentOS conversion some time ago (see his blog post here). Dan is a Microsoft Premier Field Engineer based in Rome and does a lot with OpsMgr cross platform and other Linux OSes. Look for more from Dan in the future!

 

Getting Started

I will assume you already have some of the prerequisites set up here, like an OpsMgr 2007 R2 Management Server, a Windows Server 2008 R2 Hyper-V server (you can even host a VM of the OpsMgr server), the System Center Operations Manager 2007 R2 Cross Platform Update downloaded and installed, and access to the CentOS distribution ISO file(s).

The first thing I did was set up a CentOS virtual machine on my Hyper-V server host. CentOS 5.4 installed easily, and I also added the Linux Integration Components for Windows Server 2008 R2 (version 2.0) for Hyper-V (even though SUSE was the supported platform). I used the default installation but made sure that development components were installed. I set the firewall to disabled and SELinux setting to permissive. In a real environment, these settings would likely be different, but I’m just testing here, and being new to all this, I took it easy on myself.

Once the CentOS VM was up and running, I needed to test the existing Red Hat agent on the CentOS machine. This would tell me whether this was going to be a simple find & replace of XML strings or whether it was going to require some C++ coding.

Handy Tip: The UNIX and Linux agents are located in the following directory on the OpsMgr server:

C:\Program Files\System Center Operations Manager 2007\AgentManagement\UnixAgents

Since I was looking for the Red Hat agent, I looked for “RHEL” and I found the most appropriate agent, which was scx-1.0.4-252.rhel.5.x64.rpm.

Note: At first I tried scx-1.0.4-248.rhel.5.x64.rpm and wondered why it wasn’t installing. I then realized that the file was just a text file, and that the latest update of the cross platform support for OpsMgr had installed new agents (the 252 version) and changed the 248 version agents to the text files. So, make sure you look further down the directory listing for the latest agent before you try to install it.
 

In order to get the agent to the CentOS computer, I used PuTTY Secure Copy (pscp.exe) to push the file over from the OpsMgr server to the VM. This is run from a command prompt on the OpsMgr server:

pscp -p -pw <password> <source file to copy> root@<server>:<dest filename>

image

I then ran rpm -i scx-1.0.4-248.rhel.5.x64.rpm on the CentOS VM and waited for it to finish. I verified the package was installed by typing rpm –q scx, which returned “scx-1.0.4-252”. I verified the CIM daemon was running by typing service scx-cimd status, which returned “Checking for service Microsoft SCX CIM Server scxcimserver (pid 18106) is running...”

So the agent package installed and the CIM server is running. Now I need to check if the CIM classes have been created and populated. I could do that either from the CentOS client using the scxcimcli utility, or by using WinRM from the OpsMgr server. For now I just used the local scxcimcli utility. I typed the following commands and verified the information was being populated:

  • ./opt/microsoft/scx/bin/tools/scxcimcli -n root/scx ei SCX_OperatingSystem
  • ./opt/microsoft/scx/bin/tools/scxcimcli -n root/scx xq "select name from SCX_DiskDrive"
  • ./opt/microsoft/scx/bin/tools/scxcimcli -n root/scx xq "select * from SCX_FileSystemStatisticalInformation"

Here is the output for the first command:

image

Ok, so I’ve successfully installed the agent and verified that things appear to be worked as expected. This is good news! It means that apparently using the existing Red Hat agent is good enough to provide initial support for CentOS, and that I won't have to go writing C++ code.

Up next – creating a management pack to actually use the information.

We are happy to announce the release of the Cross Platform Audit Collection Services for Operations Manager 2007 R2. This feature extends the existing Audit Collection Services and Cross Platform features in R2 to include UNIX and Linux Event auditing.

Cross Platform Audit Collection Services allows you to collect events from UNIX/Linux servers and have Operations Manager 2007 R2 ACS collect them in the same way the Windows events are collected. Reports can then be viewed to show the collected events (the reports are included with the Cross Platform Audit Collection Services installer) .

Three downloadable components are required for Cross Platform Audit Collection Services:

For Cross Platform ACS to function, the existing R2 Cross Platform Management Packs were updated. They are not required for normal Cross Platform operation, only for Cross Platform ACS. These Management Packs can be downloaded from within the Operations Manager 2007 R2 Console or directly from the link above.

Note: With these updated MPs, Language Packs have been introduced (versus full MPs containing all languages as was the case with the Release of R2). If you are using a localized version of Operations Manager, you will need to download and install the English Updated Management Pack and any Language Pack that you require.

The logic as to which events are to be collected for each of the UNIX/Linux Servers is included in the Cross Platform Audit Collection Services Management Packs. There is a UNIX ACS Management Pack that is required by all the platforms, as well as individual Management Packs for each supported Platform (for example, SUSE Linux Enterprise Server 11). These Management Packs can be downloaded from within the Operations Manager 2007 R2 Console or from the link above.

Note: The Cross Platform Audit Collection Services Management Packs are currently only available in English.

Finally, the Cross Platform Audit Collection Services Installer needs to be downloaded and installed. Cross Platform ACS should be installed only on Operations Manager Management Servers that actively monitor the UNIX/Linux Servers. Also, an ACS Collector needs to be configured and the ACS Forwarder on the Management Server needs to be enabled. The RMS should not act as an ACS Collector/Forwarder. For more information on best practices and how to install Cross Platform ACS, check out the Deployment Guide. The Cross Platform Audit Collections Services Installer can be downloaded from the link above.

Note: As with the Cross Platform ACS Management Packs, the Installer is currently only available in English.

For more information on installing and configuring the Cross Platform Audit Collections Services feature and installing the included report, refer to the Deployment Guide (available on the download page with the Installer).

 The documentation can be access directly via the following links:

 

0 Comments
Filed under: , , ,

One of the initial configuration requirements (and one of the top things new users forget to do) for cross platform monitoring is setting up the user accounts to use for privileged and non-privileged actions. But what exactly are privileged and non-privileged actions? Why would you need one or the other?

When performing remote operations on clients such as monitoring, diagnostics or remediation, the agent performs these actions running as a specific user account (the “Run As” account specified by the administrator). The recommended security practices call for specifying a low-privilege account for most actions and using a higher-privilege account only where necessary. This segregates security privileges according to the types of actions performed and can help prevent inadvertently assigning tasks outside of the user’s security scope.

You assign Run As accounts to multiple computers through Run As Profiles, and assign the profile to the group of computers. When you install Operations Manager R2 Cross Platform extensions, it creates for you two profiles under Administration > Run As Configuration > Profiles. These profiles are named Unix Action Account and Unix Privileged Account. These profiles are pre-assigned to the various monitors and tasks within the UNIX and Linux management packs, so that once the actual accounts are specified, they need to be set up only once and all of the UNIX/Linux MPs will now work.

They key is that the user accounts need to be defined in the Run As Profile for the profile to work. There’s no obvious indication in the console that these accounts aren’t defined in the profile, but your MP’s will not work until the accounts are added.  (See: How to Create  a Run As Account in Operations Manager 2007)

Ok, so you understand the basics of Run As accounts and profiles – but which tasks require which profile? Generally, monitoring actions do not require privilege, but many remediation actions do. This is because they are stopping / restarting processes or daemons and we don’t want that happening accidentally. Also, deploying agents does not require privilege, but installing and uninstalling requires a privileged account.

Here are some links to specifics about the actions requiring privilege across the supported operating systems (latest OS version shown, but other versions similar and in the same documentation):

We are happy to release several cross platform-specific PowerShell scripts to help automate the discovery of UNIX/Linux servers, installation and upgrade of the cross platform agents for Operations Manager 2007 R2, signing of the certificates, and changing the Management Server managing the UNIX/Linux server.

Four PowerShell scripts are currently available:

  • ChangeUnixIsManagedBy.ps1
  • DiscoverUnixAgent.ps1
  • InstallUnixAgent.ps1
  • UpgradeUnixAgent.ps1

Each of these scripts is covered in this article, and help for each of these scripts is available by running the script without any parameters.

These four scripts leverage several helper scripts, which do not perform any actions on their own (and return no output if run on their own):

  • ChangeUnixIsManagedByImpl.ps1
  • DiscoverUnixAgentImpl.ps1
  • InstallUnixAgentImpl.ps1
  • scx.ps1
  • UpgradeUnixAgentImpl.ps1

The .zip file attached contains the files noted above.

Note: All of these scripts require PowerShell to be installed and are run from a Windows computer (not from a UNIX/Linux client computer).

 

ChangeUnixIsManagedBy.ps1

The ChangeUnixIsManagedBy script is used to change the current management server monitoring a UNIX/Linux server (or group of UNIX/Linux servers) to a new server as specified in the command line parameters.

The script accepts a list of Unix/Linux hosts on the input pipe.  These hosts are represented either as strings with fully qualified domain names (FQDN) or as objects with a "ComputerName" string property with the FQDN.

The output of the script is a list of objects with a "ComputerName" string property with the FQDN of the Unix/Linux host and a "Status" property with the status of the operation for the current host.

The following parameters can be used with the ChangeUnixIsManagedBy script:

Parameter Definition
RootManagementServer Name of OpsMgr root management server to use or empty string to use current computer (default)
ManagementServer Management Server to assign (required)
Target Additional computer to change management server for (done before any hosts are piped into script)

 

Usage:

ChangeUnixIsManagedBy.ps1-RootManagmentServer:<RMS FQDN> -ManagementServer:<MS FQDN>
-Target:<Target Computer FQDN>

Examples:

You have a Linux computer named SLES10-1.contoso.com and you want to change its Management Server to ContosoMS2.contoso.com, so you would use the following command:

ChangeUnixIsManagedBy.ps1 -ManagementServer:ContosoMS2.contoso.com
-Target:SLES10-1.contoso.com

Note: The script can also be executed without the parameter names, but only if all the parameters are provided. For example:

ChangeUnixIsManagedBy.ps1 ContosoRMS.contoso.com ContosoMS2.contoso.com
SLES10-1.contoso.com

InstallUnixAgent.ps1

The InstallUnixAgent script is used to deploy and install the Operations Manager Cross Platform Agent on the UNIX/Linux server(s). Running this script will first deploy the agent to the specified UNIX/Linux server and then install it.

The script accepts a list of UNIX/Linux hosts on the input pipe. The hosts are represented either as strings with fully qualified domain names (FQDN) or as objects with a "ComputerName" string property with the FQDN.

The output of the script is a list of objects with a "ComputerName" string property added/changed to contain the FQDN of the Unix/Linux host and a "Status" property added/changed to contain the status of the operation for the current host. All status strings except 'OK' are an error message.

The following parameters can be used with the InstallUnixAgent script:

Parameter Definition
Port Port to connect to at remote host (default is 22)
RootManagementServer Name of OpsMgr root management server to use, or empty string to use current computer (default)
Username User name to use for connecting to remote host (required)
Password Password for specified username (required)
PackageName Name of package to install (required, name of package file)
PackagePath Full path (on the Operations Manager server) to package being installed (required, name of folder with package file)
Distro Distribution or OS name (required, one of AIX, HPUX, Solaris, RHEL or SLES)
Version OS version of the remote host (required, one of 11iv2, 11iv3, 4, 5, 5.3, 6.1, 8, 9, 10, 11)
Architecture OS architecture of the remote host (required, one of Powerpc, IA64, PARISC, SPARC, x86 or x64)
Target Additional remote computer targeted for install (done before any hosts piped into script)


Usage:

InstallUnixAgent.ps1-Port:<SSH Port Number> -RootManagmentServer:<RMS FQDN>
-Username:<username> -Password:<password> -PackageName:<Agent Package Name>
-PackagePath:<Full Path to Package> -Distro:<Distribution> -Version:<OS Version>
-Architecture:<Architecture> -Target:<Target Computer FQDN>

Example:

To deploy and install the x86 version of the SUSE Linux Enterprise Server 10 (SLES) Agent to the computer named SLES10-1.contoso.com, the following would be used:

InstallUnixAgent.ps1 -Username:root -Password:password -PackageName:scx-1.0.4-248.sles.10.x86.rpm -PackagePath:”C:\Program Files\System Center Operations Manager 2007\AgentManagement\UnixAgents” -Distro:SLES –Version:10 -Architecture:x86
-Target:SLES10-1.contoso.com

Note: The script can also be executed without the parameter names, but all the parameters must be provided.

UpgradeUnixAgent.ps1

The UpgradeUnixAgent script is used to upgrade an existing Operations Manager Cross Platform Agent on a UNIX/Linux server.  This is done by first deploying the updated agent to the remote UNIX/Linux server and then installing it (upgrading).

Usage:

UpgradeUnixAgent.ps1-Port:<SSH Port Number> -RootManagmentServer:<RMS FQDN>
-Username:<username> -Password:<password> -PackageName:<Agent Package Name>
-PackagePath:<Full Path to Package> -Distro:<Distribution> -Version:<OS Version>
-Architecture:<Architecture> -Target:<Target Computer FQDN>

Example:

To upgrade an existing SLES agent to a new version (e.g., version 1.0.4-252), you would use the following command:

UpgradeUnixAgent.ps1 -Username:root -Password:password -PackageName: scx-1.0.4-252.sles.10.x86.rpm -PackagePath:”C:\Program Files\System Center Operations Manager 2007\AgentManagement\UnixAgents” –Distro:SLES –Version:10 –Architecture:x86
–Target: SLES10-1.contoso.com

DiscoverUnixAgent.ps1

The DiscoverUnixAgent script is used to sign the certificate used for communication and discovering an instance of the UNIX/Linux Server into Operations Manager.

The script accepts a list of UNIX/Linux hosts on the input pipe. The hosts are represented either as strings with fully qualified domain names (FQDN) or as objects with a "ComputerName" string property with the FQDN.

The output of the script is a list of objects with a "ComputerName" string property added/changed to contain the FQDN of the Unix/Linux host and a "Status" property added/changed to contain the status of the operation for the current host. All status strings except 'OK' are an error message.

The following parameters can be used with the DiscoverUnixAgent script:

Parameter Definition
Port Port to connect to at remote host (default is 22)
Server Name of OpsMgr server to use or empty string to use current computer (default)
RootManagementServer Name of OpsMgr root management server to use or empty string to use current computer (default)
Username User name to use to connect to remote host (required)
Password Password to use to connect to remote host (required)
Distro Distribution or OS name (required). (see below for valid combinations of operating systems, versions and architectures)
Version OS version of the remote host (required). (see below for valid combinations of operating systems, versions and architectures)
Architecture OS architecture of the remote host (required) (see below for valid combinations of operating systems, versions and architectures) 
Target Additional remote computer to discover (done before any hosts piped into script)


Valid combinations of operating systems, versions and architectures:

OS Valid versions Valid Architectures
AIX 5.3 | 6.1 Powerpc
HPUX 11iv2 | 11iv3 PARISC
Solaris 8 | 9 | 10 SPARC
  10 x86
(ver > 120012-14)
RHEL 4 | 5 x86 | x64
SLES 9 x86 | x64
10 | 11 x86 | x64
      

 

Usage:

DiscoverUnixAgent.ps1-Port:<SSH Port Number> -Server:<OpsMgr Server>
-RootManagmentServer:<RMS FQDN> -Username:<username> -Password:<password>
-Distro:<Distribution> -Version:<OS Version> -Target:<Target Computer FQDN>

Example:

To sign the certificate and discover the x86 version of the SUSE Linux Enterprise Server 10 (SLES) Agent to the SLES 10 server named SLES10-1.contoso.com, the following would be used:

InstallUnixAgent.ps1 -Username:root -Password:password -Distro:SLES -Version:10
-Target: SLES10-1.contoso.com

As before, the script can also be executed without the parameter names, however, in these instances all the parameters must be provided.

 

Chaining the PowerShell Scripts

The Cross Platform PowerShell scripts are designed so that they can be chained together. For example, you may want to deploy, install, sign, and discover a single UNIX/Linux server (or a group of UNIX/Linux servers) by using a single command. This is done the same way other PowerShell scripts are chained together - by piping the output of one command into the input of the next.

However, in these instances, we want to make sure that the output from one command is only piped into the next if the action being performed was successful. For example, if the initial agent installation fails, we don’t want to attempt to discover the server into Operations Manager. This can be done in a couple of ways.

Examples:

This command passes the output from the first script into the second script, but only if the first one was successful:

Type File_of_hosts | InstallUnixAgent.ps1 | Where { $_.Status -eq "OK"} | DiscoverUnixAgent.ps1

This command passes the output from the first script into the second script, but only if the first one was successful. Otherwise, it will write out an error status:

Type File_of_hosts | InstallUnixAgent.ps1  | foreach { if ($_.Status -eq "OK")
{ Write-Output $_ } else { Write-Error $_.Status } } | DiscoverUnixAgent.ps1

This example adds another piped command to return a list of the UNIX/Linux Servers against which the scripts were run and the outcome of each:

Type File_of_hosts | InstallUnixAgent.ps1  | foreach { if ($_.Status -eq "OK")
{ Write-Output $_ } else { Write-Error $_.Status } } | DiscoverUnixAgent.ps1 | Foreach { Write-Host $_.ComputerName $_.Status }

 

We are pleased to announce the release of the System Center Operations Manager 2007 R2 Connectors!  The Connectors are available for download at the following location:

 

               http://www.microsoft.com/downloads/details.aspx?FamilyID=592e4143-c5c8-4270-9a7a-cd0a31ab3189

 

The Operations Manager 2007 R2 Connectors provide Operations Manager 2007 R2 alert forwarding to remote systems, such as an Enterprise Management System (EMS) or a help desk system. After Operations Manager 2007 R2 forwards an alert to a remote system, the alert data is synchronized throughout the lifetime of the alert.  The result of that data synchronization is a robust and seamless systems management environment. Such an environment enables cross-organization support processes to take advantage of the resources and strengths of formerly independent support groups. The ultimate effect is improved enterprise systems health through improved organizational communication.

 

Sharing data between Operations Manager 2007 R2 and remote systems enables enterprise correlation of events from Windows-based systems, hardware, network, and UNIX systems. Correlating these events allows IT staff to determine the causes of issues and reduce the time to resolution of IT outages.  Synchronization of data between Operations Manager 2007 R2 and remote systems also enables operational groups to use familiar management interfaces. Users update an alert by using their management tool, and the data is updated in tools that are used by other operational groups.

 

The following connectors are available in this initial RTM:

-          Operations Manager 2007 R2 Connector for IBM Tivoli Enterprise Management Console

-          Operations Manager 2007 R2 Connector for HP Operations Manager (formerly HP OpenView Operations)

-          Operations Manager 2007 R2 Connector for BMC Remedy Action Request System (ARS)

-          Operations Manager 2007 R2 Universal Connector

  

For more information regarding the Connectors, you can review the following resources:

 

Download Details:

-          http://www.microsoft.com/downloads/details.aspx?FamilyID=592e4143-c5c8-4270-9a7a-cd0a31ab3189

 

TechNet Documentation:

-          http://technet.microsoft.com/en-us/library/dd795265.aspx

 

TechNet Forums:

-          General:  http://social.technet.microsoft.com/Forums/en-US/interopgeneral/threads

-          Connector for IBM Tivoli Enterprise Console:  http://social.technet.microsoft.com/Forums/en-US/interoptivoli/threads

-          Connector for HP Operations Manager:  http://social.technet.microsoft.com/Forums/en-US/interophpoperationsmanager/threads

-          Connector for BMC Remedy ARS:  http://social.technet.microsoft.com/Forums/en-US/interopremedy/threads/

-          Universal Connector:  http://social.technet.microsoft.com/Forums/en-US/interopuniversalconnector/threads

 

We are happy to announce that the Cross Platform Extensions Beta 1 refresh is now available on the Microsoft connect site - http://connect.microsoft.com.  We appreciate the feedback on the product received to date and hope you will continue this.  Please let us know if you have any questions.

 This Beta refresh adds three new features to the product that customers have been asking for:

·         Support for OpsMgr Server running on 64-bit systems

·         Gateway role support

·         AIX 5.3 support

 

 

More Posts Next page »
 
Page view tracker