Posted on 05-11-2010 09:42 AM
Hello Casper List,
Is it possible to have Casper pop-up a message when a policy starts to run? I know there is an option to have the message pop-up after its completed, and the system is ready to be restarted, but I'd like a message to pop-up warning the user that updates/installs are taking place in the background. Any ideas on how to do this? I'm guessing this feature is not built-in to Casper since I haven't been able to find it in the documentation.
Thanks for your help in advance!
--
Ted August
Salve Regina University
Posted on 05-11-2010 09:53 AM
You could use the built in notification system that Casper uses, utilizing
On Tue, May 11, 2010 at 11:42 AM, Ted August <taugust04.lists at gmail.com>wrote:
the JAMF binary:
jamf DisplayMessage -message "Updates are being installed."
However it will require the user to click "Ok" to clear the message. Not
sure what the behavior is if there is no one at the machine in question,
when the updates finish does the second displayMessage from Casper override
or do you now have two dialogs to dismiss?
A method I use is to utilize Growl and growlnotify to notify users of things
taking place. If you do a search in the archives for the subject "notifying
users" you will come across a thread where this is discussed.
Basically, load Growl and growlnotify on all of your machines, then use a
script to call growlnotify as a Before script. You can pass, as arguments,
things like the icon to use, the title of the window, and whether it is
sticky or not. For example, i use this to display a "please restart"
message to my users:
/usr/local/bin/growlnotify -a "Finder" -t "Restart Required" -m "Your
computer has been up for $num days. Please restart as soon as possible." -s
That is part of a larger script, but you get the idea.
Hope that helps.
Steve
Posted on 05-11-2010 09:55 AM
I do this using a script calling the JAMF biniary and run it "Before"
On 5/11/10 11:42 AM, "Ted August" <taugust04.lists at gmail.com> wrote:
executing a policy.
The JAMF CLI has this command:
jamf displayMessage -message 'Your message here...'
It doesn't work over the login window in 10.5 and 10.6, but if no one's
logged in then it shouldn't really matter.
--
William Smith
Technical Analyst
Merrill Communications LLC
(651) 632-1492
Posted on 05-11-2010 10:14 AM
There are many ways to do this, as I have some of these in my scrips. Some examples:
/usr/bin/osascript >>EndOfApplescript tell application "System Events"
display dialog "Hello World!"
end tell EndOfAppleScript
You can call that from bash, you can also use the Finder to display messages and you can customize it to do lots of things. You can output OK and Cancel to a number number, then use if/then to determine your policy. This works awesome with command line trigger policies in casper and scripts. Right now part of my post image script uses apple script to log in a user, then display a message that system updates are being ran, and then runs software update from the command line. That way any tech who reimages a machine will know what it is doing just by a visual check.
Any software install via self service that requires a reboot, runs through the script and tells the user that they need to back up their data now or they will lose nay unsaved info. If they hit cancel the script cancels, if they hit OK it proceeds. However, those trigger policies and scripts are actually all in testing phases with me right now so I don't have any in my live environment.
Using Apple Script from bash is actually nothing short that awesome. I suggest any and every sys admin learn how to use it. Comes in quite handy.