From caee65e326c781696c3bac5d347578f830b0fb5e Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 9 Jul 2009 19:07:59 -0400 Subject: Adding notify_via_growl() function which assists in sending growl messages to your device. Will be used to alert important things such as wan down, wan high latency, etc. --- etc/inc/pfsense-utils.inc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'etc/inc') diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 24e478e..f6669c9 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -1666,4 +1666,23 @@ function isvm() { return false; } -?> +/****f* pfsense-utils/notify_via_growl + * NAME + * notify_via_growl + * INPUTS + * notification string to send + * RESULT + * returns true if message was sent + ******/ +function notify_via_growl($message) { + require_once("growl.class"); + global $config; + $growl_settings = &$config['notifications']['growl']; + $growl_ip = $growl_settings['ipaddress']; + $growl_password = $growl_settings['password']; + $growl = new Growl($growl_ip, $growl_password); + $growl->register(); + $growl->notify("pfSense growl alert", "", "{$message}"); +} + +?> \ No newline at end of file -- cgit v1.1