Skip to main content
Question

Using iHook for Notifications

  • November 2, 2009
  • 0 replies
  • 21 views

stevewood
Forum|alt.badge.img+38

A lot of talk has been done lately about using Growl Notify for
notifications to users about installs. Or how to possibly use jamfHelper to
do this. Or...name your poison. Well, I remembered back to the days of
looking at Radmind for management, that there was a product named iHook that
they used for end user notification. It was a fairly simple program to use
and it would basically take over the machine when you used it. iHook was
written to work as a login or logout hook, which is exactly what I wanted to
use it for. So, off I went last week testing the implementation, and the
result was pretty cool.

First thing you'll need is a copy of iHook. You can grab that off the
Research Systems Unix Group at the University of Michigan:
http://rsug.itd.umich.edu/software/ihook/

Once you've got that, you'll need to write a few "iHook" scripts to run and
take care of your stuff. Now my goal was to be able to install cached
software at login or logout and alert the user. The immediate things were
the 10.5.8 update and CS4. The way you invoke iHook, or at least the way I
am invoking it, is to call iHook in a script and give it a path to the
actual "hook" that I want it to run. So, I have a script in Casper named
"installcached.sh" that contains this script:

#! /bin/sh

/usr/local/bin/iHook.app/Contents/MacOS/iHook --no-titlebar
--script=/usr/local/JAMF/hooks/install.hook

The "hook" script it calls, install.hook, contains the following code:

#!/bin/sh

echo %BACKGROUND /usr/local/JAMF/images/iHookBack.png
echo %WINDOWSIZE 1024 768

jamf installAllCached

So, now that we have those scripts written, let's look at how I installed
this. I decided the /usr/local folder structure was the best place to put
all of this. So I put the iHook.app binary in the /usr/local/bin folder,
then I created a JAMF folder at /usr/local/JAMF and inside of that put two
folders: images and hooks. This provided me a way to put any background
image up and run whatever hook I wanted.

So, I used Composer to create a package to install the binary and the
background image and the install.hook files. I then used ARD to push the
package out to my machines, only because it was easier then adding to Casper
and pushing via policy or something, for now.

Now that I have the iHook framework loaded, I created a policy to run on
logout (I also tested with login and it works) that simply calls the
"installecached.sh" script. Once the user does a logout or restart or
shutdown of their computer, the script runs, calls iHook with my background
and installs all cached packages. This is a machine going through an Adobe
installation:

[image:
?ui=2&view=att&th=124b75323c4a760c&attid=0.1&disp=attd&realattid=ii_124b75323c4a760c&zw]

As you can see, you get a timer in the upper right corner indicating how
long it has been running, and you get the description of what is being
installed. You can script in a progress bar along with a bunch of other
things that are described in the iHook DMG file from UMich.

I'm still playing around with this, but this is definitely going to help me
deploy 10.5.8 and CS4 later in the month, and keep my users aware. Anything
that you can script can be run as the "hook", so if you wanted to run disk
permissions repairs, or anything else, you can.

Hope this helps some people out.

Steve Wood
Director of IT
swood at integer.com

The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
T 214.758.6813 | F 214.758.6901 | C 940.312.2475

![external image link](attachments/900286005b314998bdc38cfcc0b5c675)