What is MunkiReport
MunkiReport is a web-based reporting interface for Munki clients. It’s cool to deploy a bunch of Munki clients, but it’d be nice to know how many are out there, and any errors or pending installs there may be on those clients.
If you haven’t set up your Munki server yet, do that first!
Assumptions (for simplicity’s sake)
There are many different possible scenarios for installing MunkiReport, but for simplicity’s sake, we’re going to make some assumptions. If you’re really advanced, you can obviously adapt these instructions for your particular case. If not, follow as is.
- You are using a Mac computer as a server.
- You installed munki_repo to a subdirectory of the server directory.
- You are going to install MunkiReport to the root directory of your web server.
- You are going to do all of these instructions from your web server (and not from a client computer).
Making sure the web server is PHP-ready
Apparently, Mac OS X by default does not interpret PHP correctly when you launch up the Apache service. So let’s make sure that’s good first.
In the Terminal.app, edit the appropriate file using nano (or your editor of choice)
If you see a line that looks like this:
change it to look like this instead
Then save out (if you’re using nano, Control-X we save).
Then restart apache
A) Downloading MunkiReport with Git
If you have Git installed, you can do a git clone on MunkiReport.
git clone https://github.com/munkireport/munkireport-php.git munkireport-php-master
B) Downloading MunkiReport with a web browser
Using a web browser on the web server itself, go to the MunkiReport GitHub repository and click the Download ZIP button to download the latest version. When you get the .zip file, you may have to double-click it to unzip it. Once it’s unzipped, you should have a folder with all the necessary files in it.
Installing MunkiReport
Copy the contents of the folder (not the folder itself) to your web server’s root directory. Make sure the file ownership/permissions match that of the other files or folders in there (e.g., whatever index.html file says It works! when you first got your web server up and running.
If you no idea, then make it all 755 permissions with ownership of root:_www.
Here’s an example to paste into the Terminal.app:
sudo chmod -R 775 ~/Downloads/munkireport-php-master/*
sudo mkdir -p /Library/WebServer/Documents/munkireport
sudo mv ~/Downloads/munkireport-php-master/* /Library/WebServer/Documents/munkireport/
sudo cp /Library/WebServer/Documents/munkireport/config_default.php /Library/WebServer/Documents/munkireport/config.php
The last command just makes a copy of the default config to a new custom config file. You will need both (I thought, at first, that I could ditch the default config file, but then I got an error when I loaded up the page in a browser).
Note: If you’re using OS X Server, the path is typically /Library/Server/Web/Data/Sites/Default and not /Library/WebServer/Documents
If all went well, you should be able to go to http://localhost/munkireport and enter a first username and password. This doesn’t actually create a user. All it does is create a hash.
Once you have the password hash created, highlight the results and then paste them in at the end of the config.php file on the web server. If you ever need to generate another hash again, go to http://localhost/index.php?/auth/generate and enter in more credentials.
When you do log in, you should see… nothing. No clients.
To create a client, paste these commands into the Terminal.app
/usr/local/munki/munkiimport ~/Desktop/munkireport-2.11.0.pkg
Replace nameofyourdomain with your actual domain name or the server’s IP address.
Note: if you’re using https with a self-signed certificate, you may want to run
instead of the first command.
Note: the version number may change, so after you type ~/Desktop/munkireport-, just hit Tab to autocomplete, instead of typing in the number (it’s faster to autocomplete anyway).
Once you have that package imported, and have rebuilt your Munki catalogs when prompted, go ahead and them to the appropriate manifests so they can be pushed out to your existing clients.
If you are well-versed in MySQL and prefer that to MunkiReport’s default sqlite database, read Using MySQL with MunkiReport for some implementation tips.
Leave a Reply