How to Use TrakMac

Information

TrakMac is a program that audits the current state of a Mac on your network and then posts that audit to your Issuetrak web server.  It is the Mac counterpart to TrakPC.  Both TrakMac and TrakPC are extensions to Issuetrak's Asset Management module. 

TrakMac requires a minimum OS version of 10.13 in order to work properly.

While we describe the available command line options, syntax, and general use of TrakMac here, we do not describe the actual deployment of TrakMac.  You will need to deploy TrakMac using the method that best suits your environment, needs, and established methods of system administration.

Initial Setup

This is a set of instructions to get started with TrakMac.

  1. Find TrakMac.  It is included in the Issuetrak web folder as TrakMac.zip, which is found within the TrakPC folder. 
  2. Transfer TrakMac.zip to the Mac that will be hosting TrakMac for the other Macs on the network.  It is important that the file is hosted on a Mac and not on a Windows machine.
  3. Create a shared network folder on the Mac that will be accessible from the other Macs, and then extract TrakMac.zip within that folder.  This will create a folder called TrakMac.
  4. Open a terminal and run the _prepareTrakMak.sh script found within the TrakMac folder.  This will take a few seconds, and removes the quarantine file attribute from all files within this folder, allowing the files to be executable.
  5. Ensure the Folder and has read permissions for group and other via the command: ls -al
    • Permissions may be granted to the folder with the command: chmod ugo+r -R ./
  6. As a test, run TrakMac from a terminal and direct it to your Issuetrak site using the URL command line option found below. 

Command Line Options

You can pass command line options to TrakMac, which will allow you to target a Issuetrak site to post audits to, as well as determine how often audits should be posted from the current machine.  It is also possible to run TrakMac without command line options, which will result in an XML audit file being generated locally without posting it to a site. 

TrakMac supports two command line options:  URL and Frequency.

URL Option

The URL option is passed to TrakMac with a /u switch.  The URL must immediately follow the /u without any spaces.  TrakMac supports posting to both SSL and non-SSL sites.  The URL should be the root of your Issuetrak site.

Usage Example

./TrakMac /uhttps://myissuetraksite

The example above tells TrakMac to post its audit to https://myissuetraksite

 
Frequency Option

The Frequency option is passed to TrakMac with a variation of the /f switch.  There are several rules to be aware of for this option: 

  1. The Once and Daily variations have no possible switch values. 
  2. When switch values are specified, it must be specified immediately after the switch without a space.
     
    • Incorrect Syntax
      ./TrakMac /uhttps://myissuetraksite /fw 0
    • Correct Syntax
      ./TrakMac /uhttps://myissuetraksite /fw0
  3. If no switch value is specified, then TrakMac will use the last-modified date/time of the ~/.trakmac-last-run file as the last run date when determining if it should run now. 

File Structure

Since Macs are descended from UNIX-based systems, it is important to know a few properties of the file structure as it relates to Macs and TrakMac:

  • Any path that is specified with a tilde (~) at the beginning refers to the home directory of the user that is currently signed into the Mac.
  • Any file or folder that begins with a period (.) is hidden when the ls command is given in a terminal window, as well as when viewing files and folders from within Finder (the file system navigation tool found on every Mac).  The period is actually part of the file or folder name, and does not just specify the hidden file property. 
  • Therefore, all references to ~/.trakmac-last-run indicate a hidden file named .trakmac-last-run that is located in the current user's home directory.  

The following frequency variations are supported:

Frequency Switch Switch Values Additional Comments
Once /fo N/A Directs TrakMac to post a one-time audit.  This is the default behavior of TrakMac when a frequency switch is not specified.
Daily /fd N/A Directs TrakMac to post an audit if there is no ~/.trakmac-last-run file or if it is not today's date. 
Weekly /fw null, 0-6

Directs TrakMac to post an audit every week on the day specified by the switch value: 

  • 0 - Sunday
  • 1 - Monday
  • 2 - Tuesday
  • 3 - Wednesday
  • 4 - Thursday
  • 5 - Friday
  • 6 - Saturday
Monthly /fm null, 1-31 Directs TrakMac to post an audit every month on the day specified by the switch value.  If the specified switch value exceeds the number of days in the current month, then TrakMac will post on the last day of the month. 
Quarterly /fq null, 0-92 Directs TrakMac to post an audit every quarter on the day specified by the switch value.  If the specified switch value exceeds the number of days in the current quarter, then TrakMac will post on the last day of the quarter. 
Yearly /fy null, MMDD Directs TrakMac to post an audit every year on the month and day specified by the switch value.  Replace "MMDD" with the month and day of the year. 

Usage Example 1

./TrakMac /uhttps://myissuetraksite /fw0

The example above tells TrakMac to create and post an audit every Sunday to https://myissuetraksite.

Usage Example 2

./TrakMac /uhttps://myissuetraksite /fm

The example above tells TrakMac to create and post an audit every month, based on the last-modified date of the current user's ~/.trakmac-last-run file.  If the last-modified date of .trakmac-last-run is last month on the 15th, then TrakMac will not post another audit until it is the 15th of the current month. 

Usage Example 3

./TrakMac /uhttps://myissuetraksite /fq80

The example above tells TrakMac to create and post an audit on the 80th day of each quarter.

Usage Example 4

./TrakMac /uhttps://myissuetraksite /fy0510

The example above tells TrakMac to create and post an audit every year on May 10th.

Usage Example 5

./TrakMac /uhttps://myissuetraksite /fy

The example above tells TrakMac to create and post an audit every year, based on the last-modified date of the current user's ~/.trakmac-last-run file.  If the last-modified date of .trakmac-last-run is last year on October 15th, then TrakMac will not post another audit until it is October 15th again. 

Example output

TrakMac (Version 1.0.1)
Copyright (c) 2020 Issuetrak, Inc. All Rights Reserved.

Gathering information...
Output file: ./TrakMac-xx-xx-xx-12-23-34.xml
14:19:43 Info:
<html>
 <head>
<script src="js/app/modules.js?v="></script>
  <title>Audit Submit</title>
 </head>
 <body>
[NewItemID=10]<br />
 </body>
</html>

Done

The example output above shows the expected output when audit XML file is successfully posted.