I have been using Growl for Windows for a few months and I think it is a very cool application. I use it mostly at home with Sickbeard and Couchpotato. In Sickbeard, when a show is snatched, that is the show has been submitted to your download manager (Transmission in my case) a notification will be sent to growl. When the the download has been completed, a notification will be sent to growl. This is especially useful when I am waiting a particular show to finish downloading.

On a Thursday night for example I am often surprised that Scandal starts downloading withing 15 minutes after its network premiere. I can now decide if I want to wait up for the download to finish and I have waited up many times.

There are a couple other features I always thought would be cool to have:

Disk Usage Alerts

Managing disk usage is very important as running out of disk space can be quite annoying. Sure, I could use a CRON script to alert by email when disk usage passes a particular threshold but I don’t always pay attention to email.
usage

NAS Start-up/Shutdown Alert

I want to be alerted when my NAS comes online and when it does a graceful shutdown. This would be a killer feature as I hate waiting on the NAS to come online and a growl alert would be very useful. In addition to a growl alert a xbmc OSD alert would be also cool! Just picture a message popping up your TV that says, “NAS Online”.

I was searching for a quick and dirty way to do this with Python. It took me awhile before I found this Python GNTP library. After doing a pip install gntp on OpenMediaVault and checking out the GNTP documentation I was quickly sending test messages to growl.

This is a work in progress and I am still very new to Python but I have three goals which may of may not change:

oracleup

oracledown

1. On NAS start-up, Growl messages – (a.) NAS Online (b.) Disk Usage
2. CRON Job to check Disk usage every 15 minutes and if disk usage is greater than 80%, Growl message should be sent with the details.
3. On NAS shutdown, growl messages – (a.) NAS going to sleep

If you are going to test this ensure that you use a password. My initial test registration would fail and it was not immediately obvious that the password was the issue.

NAS Online/Offline Scripts

Done

NAS Disk Usage script

NAS Disk Usage Threshold script

Work in progress

Code

growlhost.py file

import gntp.notifier

dell = “192.168.66.2”
kindle = “192.168.66.7”
vpn = “192.168.66.40”
host = vpn #I used to select the host I wanna growl to

growl = gntp.notifier.GrowlNotifier(
applicationName = “Oracle”,
notifications = [“New Updates”,“New Messages”],
defaultNotifications = [“New Messages”],
#hostname = “192.168.1.2”, # Defaults to localhost
hostname = host,
password = “abc123” # Defaults to a blank password
)

def gntpSend(message):
growl.notify(
noteType = “New Messages”,
title = “NAS Info”,
description = message,
icon = “http://example.com/icon.png",
sticky = False,
priority = 1,
)

Hostup.py
import gntp.notifier import growlhosts

message = “Oracle Online”

growlhosts.growl.register()

growlhosts.gntpSend(message)

HostDown.py

import gntp.notifier import growlhosts

message = “Oracle Going To Sleep”

growlhosts.growl.register()

growlhosts.gntpSend(message)