A “Do Not Disturb” application for Munki

UPDATE: I’ve tweaked this app based on the idea of Arjen van Bochoven in his comment

A Mac user complained that Managed Software Center popped up in the middle of a conference presentation. I started looking into how to suppress notifications.

do-not-disturbAs a quick fix, I created an AppleScript application which suppresses notifications for 24 hours, utilising the SuppressUserNotification key in /Library/Preferences/ManagedInstalls.plist.

The application sets the key to TRUE, and runs a preflight script every time Munki runs on a client to check whether 24 hours have passed or not, after which it will reset the key back to FALSE.

The application

If you use MunkiReport-PHP and/or Sal clients in your organisation, or else have no reporting tools, then you can download my pre-made package for distribution:
https://github.com/grahampugh/munki-do-not-disturb/releases

If you use MunkiWebAdmin or some other reporting tool which uses an incompatible preflight script, then follow the instructions for compiling it yourself, here:
https://github.com/grahampugh/munki-do-not-disturb.

(See also my earlier post on getting MunkiWebAdmin to work with MunkiReport-PHP and/or Sal).

Screen Shot 2015-07-04 at 00.46.39

Importing into Munki

Now import to Munki and place in the manifest of the people you wish to have access. The uninstall method needs changing to ensure proper removal:

Alternatives

You could permanently disable notifications, but that would mean users never become aware of updates, so some applications that require intervention such as closing blocking applications could get somewhat out of date.

There is interest in the use of Apple’s Notification Centre for Managed Software Updates, but this is not yet considered reliable. If it becomes suitable, then Apple’s built in Do Not Disturb feature could be utilised.

I’ll update this post if/when better solutions emerge.

Advertisements

7 thoughts on “A “Do Not Disturb” application for Munki

      1. Graham Post author

        I’ve now changed the app to do this. It required turning the app into a package, as the preflight script needed to be placed at installation time rather than when running the app.

        Like

  1. Graham Gilbert

    This will also work when using Sal (I assume the MR-PHP requirement comes from using /usr/local/munki/preflight.d?). Do you mind if I work on a menu bar app? I’ve been looking for something simple to learn swift with.

    Like

    Reply
    1. Graham Post author

      Yes please do. I think making it a menu bar app seems the way forward, but more than I can tackle for a while. I’ve now improved it so no admin rights are required, following Arjen’s idea.

      Does Sal create preflight.d? I had a quick look and only saw postflight.d. My new version checks whether preflight and preflight.d exist and acts accordingly. I’ll update the post in a bit.

      Like

      Reply
  2. Graham

    Yep, Sal works just the same way. I got a basic menu bar app working this avo, if I get time I’ll try and get it doing what I need this week.

    Like

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s