munki “more than one” preflight / postflight scripts

** this is the part2 of this post:**

We just saw that configuring munki client scripts to report to munkiwebadmin was not that hard if you follow the wiki.

** but what if you want to trigger more than 1 postflight script ? **

Until I use munkiwebadmin, I used to have :
– munkireports-php
– and an email reporting like the example found here : http://code.google.com/p/munki/wiki/PreflightAndPostflightScripts

Now that I use MWA, I want:

1st: restoring the email reporting (I used untill now with munkireports-php) in case of failure as this very handy.

2sd: Keep the eventuality of still using munkireports-php on the production server in my clients office — see note at the end.

I simply, made ‘new’ scripts named

postflight
preflight

in wich I then can call other scripts as needed

It is in python and looks like :

#!/usr/bin/python
#

import os
os.system("/usr/local/munki/postflight-email")

Adding 2 lines for each scripts we want to trigger for preflight and /or postflight.

I therefore renamed scripts :

renaming mwa scripts

munkiwebadmin-config (no renaming)

postflight to munkiwebadmin-postflight

preflight to munkiwebadmin-preflight

report_broken_client to munkiwebadmin-report_broken_client

renaming munkireports-php scripts

postflight to munkireports-php-postflight

preflight to munkireports-php-preflight

report_broken_client to munkireports-php-report_broken_client

email reporting

I then used the example script provided by Greg Neaggle (see above url) and named it

postflight_email

that would be the email_reporting script

And just have to call them via the ‘new’ preflight / postflights scripts.

Note :

We have to do the same for each script as they also differ from munkireports-php and munkiwebadmin.

So my preflights / postflight scripts just trigger others scripts. I then can manage preflights and postflight scripts as needed, just by adding or commenting lines.

Much more easy to manage for me.

You now can add any other preflights /postflight scripts you may have (just as we would do with php include).

Beauty is also that you can sort of “mix” bash, python, or whatever language for those ‘extra’ scripts.

MunkiWebAdmin vs munkireports-php

As I previously used munkireports-php, and now using (testing) mwa.

** My Plan would be : **

  • Using mwa for central reporting,
  • Using munkireports-php on the client site.

So I would have reports onsite AND in my central admin server.

I could also make “duplicates” postflights script to point to different mwa servers”, so that:

  • My Main admin Server has every computers managed by myself.
  • My Clients “onsite” servers have only there managed computers showing up and NOT others companies computer reporting, and keep track onsite in case of any failure of any sort of my main munki server.

This would need to implement Security for the repo (.htaccess) on each munki_repos and mwa / munkireports, if I open ports so that managed munki clients can pass through the router/firewall. and I’ll make another post when I come to this. For now all is on LANs only. I also could simply setup site-to-site VPN for ease of use.

And if I don’t say stupid things, munkireports-php is way easier to setup, in the way that it is “just” php, so we just need to put it in server web root (or elsewhere).

Munkiwebadmin, isn’t too hard to install (if you follow the wiki – or this post) but does require specific user, mysql db (optional though) and django stuff, etc… for wich I’m not willing to do on my clients production server (at the time of writing).
The simpler the server config the better.

Olivier
About

Product and graphic designer turned to be a Mac SysAdmin.

Posted in Admin, Deploy, Mac, tips tricks scripts Tagged with: , , , , , , , ,
0 comments on “munki “more than one” preflight / postflight scripts
1 Pings/Trackbacks for "munki “more than one” preflight / postflight scripts"
  1. […] ( EDIT : see  munki | munkiWebAdmin preflights and postflight scripts and  munki “more than one” preflight / postflight scripts ) […]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>