Having started on the Cross Platform & Interop team before Opalis was a part of it, I think about cross platform integration a lot. Working with Opalis these days, I think about how we can handle cross platform situations in the data center, which includes working with UNIX and Linux. Opalis includes and Integration Pack for UNIX, which includes the following activities:
Now these activities are great and form the basic building blocks of a lot of capabilities, but they require installing an agent on the remote machine, and the agent is supported on RedHat 4 and 5, Solaris 8, 9 and 10, HPUX 11.11, and AIX 5.3.
Meanwhile, the current cross platform integrations for Operations Manager support the following operating systems:
If you already have the Operations Manager cross platform agent installed, you probably don't want another agent on there as well, so utilizing the existing agent would be a good thing. In this article, I'll show you how to quickly create your own Opalis activity using the QIK CLI wizard and simple WinRM commands. This activity will be able to query the OpenPegasus (CIM) database on the UNIX/Linux computer to get information provided by the SCX Agent. In another article, I'll show you how to use the "invoke" command to run command lines on a remote computer so you can replicate all of the functionality currently provided in the UNIX IP.
The first thing to realize is that you can create a new custom object out of virtually any command line, and that using a WinRM command, you can talk to the SCX agent on a UNIX or Linux computer. For example, here's a command you can use to enumerate the SCX Agent info:
winrm enumerate http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/SCX_Agent?__cimnamespace=root/scx -username:root –password:<PASSWORD> -r:https://<computer name>:1270/wsman -auth:basic -encoding:utf-8 -skipCAcheck -skipCNCheck -skipRevocationCheck -format:#pretty
Knowing this, you can start creating your own custom activity! Here's how:
SCX_Agent SCX_DiskDrive SCX_DiskDriveStatisticalInformation SCX_EthernetPortStatistics SCX_FileSystem SCX_FileSystemStatisticalInformation SCX_IPProtocolEndpoint SCX_LogFile SCX_MemoryStatisticalInformation SCX_OperatingSystem SCX_ProcessorStatisticalInformation SCX_StatisticalInformation SCX_UnixProcess SCX_UnixProcessStatisticalInformation
Now that you have the custom IP built and imported, you can use it in a workflow. The simplest example is shown above. You can get information back using this example (you just don't have any means of acting on the information yet). But first you have to configure the activity with runtime information, like this:
Now just open it in the testing console by clicking the Test button in the toolbar. Click Run to start the policy, and when it finishes, you'll see details like this:
Of course, you can't read all of the content under Standard output, but when you mouse over it, you 'll see this:
Looks like XML, doesn't it? Well, it is! That means I can use a Query XML activity in the workflow to actually do something with the data. This part is REALLY simple… Just drag a Query XML activity (under Utilities) into the policy and link it after the Query SCX Agent activity. Open the properties and set them like this:
You now have a means to find out the architecture of the computer. Just look for the published data property of "Number of Matches" to be > 0 and you've matched a value, and the value appears in "Query Result" as shown here:
OK, that was simple, but how about if you want to get different information? I can just go back to the Query SCX Agent activity and change the namespace to any of the other values and re-run the policy. The result will show me what properties are available for me to use in the Query XML activity.
For example, changing the namespace value to "SCX_FileSystem", I get back two different instances of the class, and in each one I see the "<p:AvailableSpace>" element. Now if I change my Query XML activity to look for that element, it looks like this:
And when I run the policy in the test console, I get this:
The "<…>" means I got multi-value data back (which I can confirm because "Number of matches = 2). Opening the Published Data Browser I see my values:
Just to show you the power of this tiny little workflow, let's say I wanted to find the overall percentage of free disk space on the system. I can use a slightly more complicated XPath query to divide the available disk space into the total disk space and get that number! I just put the following text into the XPath Query box:
((//p:AvailableSpace) div (//p:FileSystemSize))
And here is the result:
I can now see that my system has 88.5% free disk space.!
Now it's your turn… go forth with this new knowledge and see what kind of information you can gather and use within your workflows using the SCX Cross Platform Agent for Operations Manager and Opalis!