Blog Posts tagged with Supporting Mac

Ask a question

KACE::'MacUtil.class error prevents agent inventory updates to KBOX with 5.3' Workaround

In some instances, when inventorying Mac agents running the 5.3 agent, a MacUtil.class error message will occur similar to this:

 

This error occurs because the agent was unable to gather all of the necessary data from SystemProfiler.  First, update the Mac agent to the latest 5.3 agent. Then follow these instructions to resolve this error.

  1. Create a manual inventory.xml file by running /Library/Application\ Support/Dell/KACE/bin/MacInventoryU > inventory.xml .
  2. View the new inventory.xml file.  If it shows a complete inventory of the system without containing any errors, then it will automatically update to the KBOX and the inventory issue will go away.

If an error message similar to this is in the inventory.xml file instead:

ash-3.2# /Library/Application\ Support/Dell/KACE/bin/MacInventoryU > inventory.xml 
2012-03-05 15:02:02.224 MacInventoryU[4599:903] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString appendString:]: nil argument' 
*** Call stack at first throw: 

0 CoreFoundation 0x99a556ca __raiseError + 410 
1 libobjc.A.dylib 0x908245a9 objc_exception_throw + 56 
2 CoreFoundation 0x99a553f8 +[NSException raise:format:arguments:] + 136 
3 CoreFoundation 0x99a5536a +[NSException raise:format:] + 58 
4 Foundation 0x943b5dc6 mutateError + 156 
5 MacInventoryU 0x00002eb7 -[SystemProfiler runProfileForDataTypes:detailLevel:] + 1423 
6 MacInventoryU 0x000027b9 -[SystemProfiler runProfileForDataTypes:] + 301 
7 MacInventoryU 0x00002017 main + 1017 
8 MacInventoryU 0x00001c02 _start + 216 
9 MacInventoryU 0x00001b29 start + 41 
10 ??? 0x00000001 0x0 + 1 

Trace/BPT trap 


The problem is related to either Spotlight being disabled on the Mac system or its Metadata is corrupt. SystemProfiler depends on Spotlight to populate its data. To resolve this conflict, the metadata file on the Mac agent will need to be rebuilt. To do this, Open Terminal (/Applications/Utilities/Terminal.app) and run sudo mdutil -i on -E /

This will rebuild the metadata file on the Mac system and it will inventory successfully in the KBOX. In some cases, this rebuild will resolve the problem permanently. However, a customer's environment may contain a few Macs that will need this process conducted on a regular basis.  To eliminate time and the need to add this workaround to the increasing daily requirements our IT customers are currently responsible for in each of their work environments, a script has been developed to impliment this task for you.

Below is the XML version of the script you can run from your KBOX:


<?xml version="1.0" encoding="utf-8" ?>
<kbots xmlns="http://kace.com/Kbots.xsd">
<kbot>
<config name="Clear MacOS Spotlight Metadata" type="policy" id="69" version="1331252818" description="This script can be used to help resolve issues dealing with problems uploading MacOS inventory to the appliance. Some of the symptoms can include incomplete inventory upload to the appliance, or getting the &quot;MacUtil.class&quot; error in the comments section of a MacOS inventory detail page.">
<execute disconnected="false" logged_off="false">
</execute>
</config>
<compliance>
<verify on_failure="break" attempts="1">
<file_exists path="/Library/Application Support/Dell/KACE/data/" file="spotlight.com" />
<on_verify_success>
<log_message type="status" message="Clear Spotlight Metadata script has already been run on this machine" />
</on_verify_success>
<on_verify_failure>
<launch_program path="/usr/bin" program="mdutil" wait="true" parms="-i off" />
<launch_program path="/usr/bin" program="mdutil" wait="true" parms="-i on -E /" />
<launch_program path="/usr/bin" program="touch" wait="true" parms="/Library/Application\ Support/Dell/KACE/data/spotlight.com" />
<on_remediation_success>
<log_message type="status" message="Clear Spotlight Metadata script successfully completed" />
</on_remediation_success>
<on_remediation_failure>
<log_message type="status" message="Clear Spotlight Metadata script failed to run" />
</on_remediation_failure>
</on_verify_failure>
</verify>
</compliance>
</kbot>
</kbots>

It will default to an Offline Kscript.

This script will create a file called "spotlight.com" in the agent log directory (/Library/Application Support/Dell/KACE/data).  If it detects that this file exists, it will not run again.

NOTE:  This workaround will not remove the MacUtil.class error message displayed on an Inventoried Mac agent summary page.  The MacUtil.class error message will be resolved in the 5.4 release. The responsibility of this workaround is to allow you to inventory your Mac units if you are faced with this problem.

If you discover that the above script only inventories your Mac units for a only a day or two and you find yourself back to the original problem, you can run the below script which will run the metadata clean even if spotlight.com is detected. This script will also update the timestamp on the last modified date on the "spotlight.com" file when it touches it again.

 

Note: IF you have upgraded to 5.4 from 5.3 and had this problem originally, the issue is fixed and the scripts are no longer needed.  However, the MacUtil error note will remain on the system in inventory.  To remove, open notes, delete the message and save.

View comments (3)

KACE::Mac::Installing Firefox through a managed install in OS X

This is an example of a typical install using the default settings in a managed install to mount a .dmg to deploy a .app file. In this case, Firefox 17.0.1 was installed on OS X 10.7.5. The instructions are compatible with all 5.3 and current 5.4.5315 KACE agents.

NOTE: Results may vary depending on the software that is being installed. Some applications may need to be repackaged in order to be installed successfully due to how the installer was built by the software developer. Most Adobe products are an example of ones that need to be repackaged.  An example of this can be found here: http://www.itninja.com/blog/view/kace-mac-installing-adobe-flash-player-through-a-managed-install-in-os-x 

To install Firefox through a managed install:

1. Install the application on a test machine.

2. Force a check in of that machine to the K1000 after the installation to test if the application is detected by the K1000. A check in can be forced by clicking on "Force Update" in the computer's inventory screen, or it can be done client-side in terminal with the below command.  NOTE: If the application does not show up, a custom inventory rule might need to be used.  See Option below.

sudo /Library/Application\ Support/Dell/KACE/bin/runkbot 2 0

Force check in from Computer Inventory: 

 

3. Go to Software Inventory and use the search bar to find Firefox. NOTE: Mac will need to be selected as the Family in the drop-down menu. Find the version that corresponds to the version of the software that needs to be installed. In this case, Firefox 17.0.1 is being used.



4. Select the supported operating system(s) and fill out Notes and Metadata as needed.

5. Upload the Firefox .dmg file to the Software Inventory item. Save the page.



6. Under the Distribution tab, click Choose Action>Add New Item.

7. Under Software, select Firefox (17.0.1) in the drop-down menu. (see screenshot under step 8)

8. Leave the settings as "Use Default". The K1000 agent will automatically mount the .dmg file and use ditto to copy the Firefox .app file to Applications (see the blue field in the screenshot for more information).



9. Set the Managed Action to the desired setting:



10. Use a label or select individual machines to limit the software deployment.

11. The software will be installed on the next system check in, or a check in can be run manually with the instructions in step 2.
 


Option: If the application does not show in Software Inventory, the steps below can be used. The primary differences are that a Software Inventory item will need to be created and that a Custom Inventory Rule should be used. The custom inventory rule will give the K1000 a way to know that the software is installed so that it does not try to install it again.

1. Navigate to Inventory>Software.

2. Click Choose Action>Add New Item

3. Title and describe as needed.

4. Select the targed operating system(s) in Supported Operating Systems.

5. Use a custom inventory rule to signify that the software is installed. NOTE: The gold question mark box will show the available options and syntax. In this example, a custom inventory rule for Firefox looks like this: /Applications/Firefox.app

Past this step, the above instructions can be followed.

 

View comments (1)

KACE K1000: Can the KBOX Agent be installed on Linux & Macintosh etc

  • Summary: The K1000 Agent can be installed on Linux and Macintosh as of version 5.0
  • Symptoms: Need to know if the K1000 agent can be installed on Linux and Macintosh
  • Cause: Need to know if the K1000 agent can be installed on Lnux and Macintosh
  • Steps to resolve issue:

Linux: Supported OS Versions:

* Red Hat Enterprise Linux (RHEL) 3, 4, and 5 (x86 and x64) 

Mac OS X: Supported OS Versions:

* Mac OS X 10.4 Intel and PowerPC

* Mac OS X 10.5 Intel and PowerPC

* Mac OS X 10.6 Intel and PowerPC

Solaris:

* Solaris clients are not support since 4.2

Be the first to comment

KACE Agent for Macintosh - Inventory Reporting Software from Other Partitions and Running VM's

Suggestions to mitigate inventory reporting issues.

Several Macs in our environment have bloated inventory. The agent is reporting software from a running Windows VM as well as other partions with the Mac OS installed. The VM's as well as the other partitions do not have the KACE Agent installed nor do we need to manage them. Any suggestions to limit the inventory reporting to only the partiton the agent is installed on would be appreciated.

View comments (7)

Scripting the fix for "Admin Alert! showing during inventory updates" on OS X 10.5 systems with Agent version 5.3.53177

The 5.3.53177 release of the KACE Agent contains a bug that causes the "Agent Alert!" icon to appear in the dock during every inventory update, even though it should only appear when an alert is pushed to the client machine. (See this ITNinja Q for more details: http://www.itninja.com/question/admin-alert-poping-on-apple-systems)

To automatically fix this issue on affected OS X 10.5 systems, I have created a script that will apply the necessary plist fix, so that it doesn't have to be manually changed on each affected system.

 

1) First, create a file named plist_fix.sh containing the following: **(The number highlighted in red must be changed to the script # you create on step 3)**

#!/bin/sh
rm -rf /Library/Application\ Support/Dell/KACE/bin/AdminAlert.app/Contents/info.plist
sleep 10
ditto /Library/Application\ Support/Dell/KACE/data/scripts/87/Info.plist /Library/Application\ Support/Dell/KACE/bin/AdminAlert.app/Contents/
sleep 5
sudo /Library/Application\ Support/Dell/KACE/bin/runkbot 4 0
exit 0

 

2) Next, create a copy of the Info.plist file located in ... with the following additional entries at the bottom of the file:

      <key>LSUIElement</key>
<true/>
<key>plist_fixed</key>
<string>Yes</string>
</dict>
</plist>

3) Finally, create an "Offline KScript" and attach the 2 files created above as dependencies, and add the following Job rules:

Verify

  1. Verify that the plist value LSUIElement in the plist /Library/Application\ Support/Dell/KACE/bin/AdminAlert.app/Contents/info.plist exists.

On Success

  1. Log plist already updated to status.

Remediation

  1. Kill the process AdminAlert.
  2. Launch $(KACE_DEPENDENCY_DIR)\plist_fix.sh with params .

On Remediation Success

  1. Log plist for 10.5 client successfully updated to output.

On Remediation Failure

    1. Log plist not successfully updated!!! to output.
 
 
 
 

The Script can be run as a 'one-time' push to all OS X 10.5 machines, or you can create a Custom Inventory Rule and Smart Label based on the plist_fixed key. You can then schedule the script to run regularly on machines which are labled as not having that plist entry.

 

The Custom Inventory Rule I used to identify machines which have had this fix applied is:

PlistValueExists(/Library/Application Support/Dell/KACE/bin/AdminAlert.app/Contents/info.plist, plist_fixed)

 

I then Created a smart label to identify the applicable (10.5) machines which did not yet have this plist entry (Keep in mind we you may have to change the ORG5 prefix to suit your environment):

 

select *, UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(LAST_SYNC) as LAST_SYNC_TIME,
             UNIX_TIMESTAMP(MACHINE.LAST_SYNC) as LAST_SYNC_SECONDS
     from ORG5.MACHINE
     LEFT JOIN KBSYS.KUID_ORGANIZATION ON KUID_ORGANIZATION.KUID=MACHINE.KUID

     LEFT JOIN KBSYS.SMMP_CONNECTION ON SMMP_CONNECTION.KUID = MACHINE.KUID

             AND KUID_ORGANIZATION.ORGANIZATION_ID = 5
     where ((((  MACHINE.CLIENT_VERSION like '%5.3.53177%')

      AND OS_VERSION like '%10.5%')

      AND (1 not in (select 1 from ORG5.SOFTWARE, ORG5.MACHINE_SOFTWARE_JT

        where MACHINE.ID = MACHINE_SOFTWARE_JT.MACHINE_ID

          and MACHINE_SOFTWARE_JT.SOFTWARE_ID = SOFTWARE.ID

          and SOFTWARE.DISPLAY_NAME = 'Fixed plist for 10.5 Machines running agent 5.3.53177')) ))

 

With this combination of Custom Inventory Rule, Smart Label, and Script, you never need worry that someone is seeing this bug on their system, as it will automatically apply this fix at the interval you specify in the script!

View comments (1)
Showing 1 - 5 of 95 results

Top Contributors

Talk About VBScript