Now that we’ve covered how to use Perl to send notifications to Growl, the immediate next question is How do I send notifications from Linux? Granted, that might not have been your immediate question, but speaking as someone who manages several Linux servers, it was certainly mine.
$ sudo perl -MCPAN -e shell $ install Net::Growl $ install Pod::Usage
I don’t recall Net::Growl requiring any prerequisites so the above should have you ready to go. The Net::Growl package includes example.pl, which shows different methods to make calls. I rewrote this script as net-growl.pl, which you can download here. Just rename net-growl.txt as net-growl.pl. The script is commented fairly well. Running the following will give you all the options.
Once you have that script ready to go, we need to check the Mac system which will receive the Growl notifications. Go to System Preferences -> Security -> Firewall. If your system is set to Allow all incoming connections and you’re fine with this setting, you’re done with this and only need to configure Growl. I’m not comfortable with any incoming connection to any application, so I have mine set to Set access for specific services and applications, as you can see below.
Click the + button, then navigate to /Library/PreferencePanes and choose Growl.prefPane.
Once done, make sure Allow incoming connections is selected for it, as has been done for SimplifyMedia and lynx in the first picture.
Now go to System Preferences -> Growl -> Network. Click the Listen for incoming notifications box and the Allow remote application registration box. Finally, enter a password in the Server Password box.
Now your Mac should be ready.
From your Linux system, run net-growl.pl as shown below. Just replace 127.0.0.1 with the IP address of your Mac system and seekrit with the password you assigned to Growl on your Mac.
$ perl ./net-growl.pl -server=127.0.0.1 -password=seekrit
The application should register itself with Growl and display a message your Mac. You can now go to System Preferences -> Growl -> Applications, click on the net-growl.pl entry, click Configure…, then set the Application’s Display Style to Prowl. Running the net-growl.pl again should result in the message being sent to your iPhone.
And that, as they say, is that. Have fun!
- Related Posts
- Create File Names for Jekyll
- Inching Toward Momento Part 2
- Inching Toward Momento
- Perl Command Line Replace
- Prowl Notifications Using WebService::Prowl
- Phoning Home
- Excluding Backblaze From Spotlight
- Bartender - A Short Review
- About Gatekeeper
- Mountain Lion - Most Skippable OS X Upgrade Ever?
- OS X Lion - Flush DNS Cache
- So Long, MacJournal
- OS X/iOS Journaling Applications
- How To Show Open Ports on OS X
- Leopard First Impressions
- Too Many Applications
- Open With Duplicates
- Smart Mailboxes
- The Infernal Modification
- MOAB - Is It Safe To Come Out Yet?
- Dvorak Has Irrational Fears
- Trackpad for Idiots, Part 1
- Gimp X11
- Textmate 2.0 to Require Leopard