Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
- Client Setup
MunkiReport is versatile in how you are able to add client machines to the reporting server. The manual option is used mostly for testing; the next method is the recommended way to distribute the setup to client machines.
The installation script is generated on the server and takes the following options:
Usage: munkireport_client_installer [OPTIONS] -b URL Base url to munki report server Current value: https://YOUR.MUNKIREPORT.SERVER/ -m PATH Path to installation directory Current value: /usr/local/munki/ -p PATH Path to preferences file (without the .plist extension) Current value: /Library/Preferences/MunkiReport -n Do not run preflight script after the installation -i PATH Create a full installer at PATH -c ID Change pkg id to ID -h Display this help message -r PATH Path to installer result plist -v VERS Override version number
Command Line (Manual) Install
The simplest form to install the client scripts is to run the following lines on the client:
munkireport_url="https://example.com/index.php?" sudo /bin/bash -c "$(curl -s $munkireport_url/install)"
This will download the installscript with curl and run it with root privileges. The install script will download all additional reporting scripts and configure the client to report back to your munkireport server.
Note: Use only for testing purposes.
Generate an Installer Package (pkg)
When the manual test above goes well, you can create an installer package by running the following package:
munkireport_url="https://example.com/index.php?" installer_output_dir=~/Desktop bash -c "$(curl $munkireport_url/install)" bash -i $installer_output_dir
You will end up with a munkireport installer package on your desktop (
~/Desktop/munkireport-x.x.x.pkg) You can then distribute this package with your favorite distribution mechanism.
Generate an Installer Package with Version Override
If you need to push out a new version to your clients (maybe you changed some client side options in the configuration), but the version of munkireport has not changed, you can override the version using the
munkireport_url="https://example.com/index.php?" installer_output_dir=~/Desktop version="22.214.171.12481201" bash -c "$(curl $munkireport_url/install)" bash -v $version -i $installer_output_dir
This will result in
You can import this package into munki which will pick up the new version number.
There is also an AutoPkg recipe for creating munkireport packages, you can read more on how to setup those on AutoPkg for MunkiReport.
Advanced Client Setup
When MunkiReport is installed on the client, 3 directories are generated:
preflight.d- this directory is used by MunkiReport to run scripts on preflight, it contains at least
submit.preflight. Scripts that exit with a non-zero status will not abort the run.
preflight_abort.d- this directory is empty and can be used for additional scripts that check if managedsoftwareupdate should run. Scripts that exit with a non-zero status will abort the run.
postflight.d- this directory is empty and can be used for additional scripts that should run on postflight.
All scripts have a timeout limit of 10 seconds, after that they're killed.
To uninstall MunkiReport just remove the installed files:
sudo rm /usr/local/munki/munkilib/reportcommon.* sudo rm /usr/local/munki/munkilib/purl.* sudo rm /usr/local/munki/munkilib/phpserialize.* sudo rm -r /usr/local/munki/preflight* sudo rm -r /usr/local/munki/postflight* sudo rm /usr/local/munki/report_broken_client sudo rm -f /usr/local/munki/smckit sudo rm -rf /usr/local/munki/munkireport* sudo rm /Library/Preferences/MunkiReport.plist sudo pkgutil --forget com.github.munkireport