PalBy:  Pål Aaserudseter

If you’re a Mac fan boy like me then you probably remember those funny Apple commercials from a few years ago including, the PC Innovation Lab. (For a refresher, check it out below.)

Now my reason for referring to this video has nothing to do with mocking a PC (a Mac is a personal computer, is it not?), but I wanted to use this video as an example of what we do here at RES Software. This video is all about innovation that makes people’s lives easier and that is EXACTLY the principle what we follow at RES Software.

Our objective is to better the user experience and reduce the burden on the IT organization through our RES Suite 2014, which is made up of the RES IT Store, RES Workspace Manager, and RES Automation Manager.

The Mac of It All
So what’s with the “Hello, I’m a Mac” title? Well, through our continued innovation, our customers now have the ability to incorporate Macs into any hybrid IT environment using RES Automation Manager. So now customers can use RES Software to manage Mac, Windows, UNIX and Linux platforms (with hundreds of built-in tasks and integrations). With this agent for the Mac, there are some awesome possibilities that I want to share with you.

I won’t go through the installation details; you can find those instructions here. Instead, I want to show you some of the cool things you can automate on the Mac.

Built-in Automation1
First, the agent runs on Apple OS X. I am personally using OS X Mavericks for automating tasks. There are several built-in tasks for the Mac that you can see in the image on the right.

These tasks are a good start and they will continue to expand in future releases. Nevertheless, note that with these existing tasks you can already control the Macs in your environment (reminds me of that song: Return of the Mack by Mark Morrison…well…anyway) and automate pretty much anything.

Automating Inventory
So what should we automate? First, let’s look at the inventory capabilities; it’s a built-in task that we can use to automate the retrieval of the inventory/asset report.

Start by clicking on that little Apple logo on the top left of the screen on your Mac and click “About this Mac” and then on More Info.

2

From there, you can get a detailed System Report. You can get all of the data in the report by using the System Profiler that is available from the command line, which I can access with the RES Automation Manager agent.

The Setup
In RES Automation Manager, I created a Module that will run a Mac OS X Command 3(Execute).  I choose to run a script using /bin/sh and use the @script placeholder so that I can input a script in the script tab. I do not need to put in security context as the agent is running as root.

In the script tab the possibilities are endless. I could run the Terminal command system_profiler, dump that content to an XML file, and then manipulate that file in whatever way I want. In this case, I want some specific information and not a complete inventory so we are going to take a different course.

By using the system_profiler command, I use a parameter like this: system_profiler –listDataTypes that gives me a complete list of the different data I can extract from the Mac.

(By the way, this gave me an idea. We could use the RES IT Store and populate a table with all the listDataTypes. This information would be presented to the user in the IT store interface where they could select what data they want. The results would be ran automatically and presented back to the user in the RES IT Store.)

Back to this blog post…based on all the DataTypes available, I only want information on hardware, display, storage, memory and network. The script will look like this.

4

Running this job will give a result similar to the one shown in the terminal window image.

5This is cool, but so far I’ve only written this out to stdOut. I need this information, so I have to keep it handy to use for inventory/asset management later on.

I changed the system_profiler command a bit so that it outputs the information that I need to XML. I even give the file an .spx extension so that it can be opened in the system profiler app on another Mac.

By writing everything I need to an XML file, I get the benefit of easily parsing this into an inventory/asset management database or similar system.

In order to write to XML, the script now looks like this:
system_profiler SPHardwareDataType SPDisplaysDataType SPStorageDataType SPMemoryDataType SPNetworkDataType –xml > MyMacSystem.spx

Here is the XML output:

6
If I open the file in the system profiler application on a Mac, this is what it looks like:

7

I think this is cool, but I bet that you can come up with many more ways to leverage this feature and others to give you better manageability of the growing number of Macs in the workplace. Share your thoughts with a comment below.

Sooo…we’re finally at the end of my long and first post on the Mac integration of RES Automation Manager. Not to worry though as it won’t be my last. I’m already thinking of new topics including:

  • Getting user/group info
  • User onboarding
  • Application installs
  • Working with native Mac apps like Automator and AppleScript
  • Invoking the Mac notification center
  • RES IT Store Integration

Until next time my fellow fan boys (and girls). Stay away from those spinning beach balls and cheers to innovation!

Signing out,

Option+Command+Esc

topodin