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)
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.
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
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
Note: if you’re using https with a self-signed certificate, you may want to run
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.
3 responses to “Installing MunkiReport”
Thank you for this write up!
For the like of me I couldn’t figure out the wiki instructions.
I’m getting this error message when I try to setup the client installer.
machine:~ admin$ sudo bash -c “$(curl http://machine/index.php?/install)” bash -i ~/Desktop/
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 93699 0 93699 0 0 10.8M 0 –:–:– –:–:– –:–:– 11.1M
bash: -c: line 0: syntax error near unexpected token `newline’
bash: -c: line 0: `’
Turns out my munkireport root was:
Which I’m told is not good, public should not be in the url.
I’m fixing that now.
Some curl commands helped diagnose the problem.
curl http://machine/index.php?/install (didn’t work)
curl http://machine/munkireport/public/index.php?/install (worked)
Thanks to the #munkireport team at Slack for their help.