What is Growl? Growl is a desktop notification app displaying Balloon-popups with information about various events. Growl is mostly home on Mac´s but there is also a Windows version. Growl can tell you when a download has finished, a new email has arrived and much more. It can also forward messages over network from one computer to another, so you can have your downloads running on one computer in the bedroom, while you are browsing the web on another computer in the living room, receiving Growl messages if a download has finished. You could also forward them as push-notification to your iPhone using "Boxcar". More info & Mac app download: http://growl.info Growl for Windows: http://www.growlforwindows.com Growl for Linux: https://github.com/mattn/growl-for-linux Display style can be customized in the desktop app, also options like display-duration and which corner of your desktop it should appear and much more. These screenshots are just very basic examples. I think this is a nice alternative or addition to email notifications from scripts running on Tomato. I will not get into too much detail about Growl itself here (assuming most people who read the topic title already know Growl) and instead focus on the simple steps to make it possible to have your Tomato router send you notifications. Requirements: - Python 2.5 or higher (tested with 2.5 and 2.7) - SSH & (S)FTP access to your router If you arent already, connect to your router over SSH. I am assuming you are doing this install from your /tmp directory. Code: cd /tmp Download & install setuptools (Check your Python version with "python -V". If you are using a different version than 2.7 in this example, get the download link for the setuptools from http://pypi.python.org and proceed accordingly) Code: wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg chmod +x setuptools-0.6c11-py2.7.egg ./setuptools-0.6c11-py2.7.egg After installation has completed successfully: Code: rm -rf setuptools-0.6c11-py2.7.egg Download & install pip Code: wget http://pypi.python.org/packages/source/p/pip/pip-1.2.tar.gz tar xvzf pip-1.2.tar.gz rm -rf pip-1.2.tar.gz cd pip-1.2 python setup.py install After installation has completed successfully: Code: cd .. rm -rf pip-1.2/ Download & install gntp Download the .ZIP from here: https://github.com/kfdm/gntp (Doesnt seem to be possible with wget@tomato, download it on your computer and upload the .zip to /tmp on your router) Code: unzip gntp-master.zip rm -rf gntp-master.zip cd gntp-master python setup.py install After installation has completed successfully: Code: cd .. rm -rf gntp-master/ Create the following files, change the mentioned lines to your own setup (If you are using Windows, pay attention to CR/LF, i recommend using Notepad++ or UltraEdit) growl-reg.py Code: import gntp.notifier growl = gntp.notifier.GrowlNotifier( applicationName = "Tomato", notifications = ["Info"], defaultNotifications = ["Info"], hostname = "192.168.1.100", password = "password" ) growl.register() Required: Change the IP to the IP of your computer that should later receive the notifications. Required: Change the password to the Growl-password you have set on your computer. Optional: applicationName is how the App will show up towards the receiver. Optional: notifications is the category it should register, it is fine to just have one. Optional: defaultNotifications is the default category to use for messages. growl.py Code: #!/opt/bin/python import gntp.notifier import sys # USAGE: python growl.py <IP-or-HOSTNAME> <TITLE> <TEXT> # these settings must be the same as used previously # when registering with growl-reg.py # if you dont want to use IP from commandline, # replace sys.argv, with your IP growl = gntp.notifier.GrowlNotifier( applicationName = "Tomato", notifications = ["Info"], defaultNotifications = ["Info"], hostname = sys.argv, password = "password" ) # Send message growl.notify( noteType = "Info", # priority can be used in the client to handle # messages differently, otherwise can be ignored priority = 1, # title is the message title (subject/header) title = sys.argv, # description is the message text (body) description = sys.argv, # If sticky is True, the message will stay onscreen until # you click on it. Can be useful for very important messages. sticky = False, # # optional: # provide callback url when growl message is clicked # example: open browser & view TomatoUSB webinterface # callback = "http://192.168.1.1", # # optional: # send along a icon for the mesage # # note: i never got this working with a local file, only this example: # icon = "http://png-4.findicons.com/files/icons/2332/super_mono/64/wireless_router.png", ) Required: Edit the top part exactly the same as in growl-reg.py! The lower part can be ignored, but it is explained what each setting does. Optional step: I have two files to call from scripts. One sends standard messages that will disappear after a few seconds. The other is for important events (High CPU load, Temperature, etc) and will send sticky messages that will stay onscreen until you click on them. If you want this too, duplicate the created growl.py from above as growl-sticky.py but change the setting to "sticky = True,". Upload the created growl-reg.py and growl.py to your router, for example to /opt Registering This is only required ONCE. Or if you want to use different applicationName or categories for the messages. Code: python /opt/growl-reg.py On your computer there should be a notification "Application Tomato has registered" Now you can send notifications using growl.py to that computer. Sending notifications Code: python /opt/growl.py 192.168.1.100 "Hello" "Hello World" Should give you a notification with the title "Hello" and the text "Hello World" on your receiving computer. From now on you can send these messages from your scripts or WebUI. For example in Webui, Administration/Scripts/WAN UP: Code: python /opt/growl.py 192.168.1.100 "WAN UP" "WAN is up with IP $(nvram get wan_ipaddr)" Or if you have certain things being done from Scheduler: Code: echo "15" > /proc/net/expire_early python /opt/growl.py 192.168.1.100 "Conntrack" "Idle connections have been dropped." Or whenever someone connects to your OpenVPN Tomato server: Add to OpenVPN custom configuration: Code: script-security 3 system client-connect /opt/connect.sh client-disconnect /opt/disconnect.sh connect.sh Code: #!/bin/sh python /opt/growl/growl.py 192.168.1.100 OpenVPN "$common_name connected from $untrusted_ip" exit 0 disconnect.sh Code: #!/bin/sh python /opt/growl/growl.py 192.168.1.100 OpenVPN "$common_name disconnected" exit 0 (Dont forget to "chmod +x connect.sh") I hope this can be useful or atleast fun to play with for someone. Enjoy. Any input is very welcome!