You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by Chris Lee <ch...@centurycity.com.hk> on 2020/04/22 02:35:07 UTC

Email Notification on Login

Hi All,

Is it possible to send email notification when some users success logon the system?

Regards,
Chris



This message and its attachment (if any) are strictly confidential and sent to the designated recipient(s) only. If you are not the intended recipient, please notify the sender by e-mail and delete this message and its attachment (if any) from your computer system immediately . Century City International Holdings Limited, Paliburg Holdings Limited, Regal Hotels International Holdings Limited, its respective related subsidiaries, associated companies and affiliates do not guarantee this message and its attachment (if any) are free of computer virus and would not accept any liability whatsoever arising from Internet transmission.

Re: Email Notification on Login

Posted by Caleb Crawford <ca...@ucsd.edu.INVALID>.
Hello Chris,

To add on to Ivan's reply, if you're using syslog you can do this with 
rsyslog itself (standard syslog daemon on most distributions these 
days). It would look something like this:

Add a file in /etc/rsyslog.d/guac-login.conf with:

# If we give out DHCP for a specific network send an alert email
$ModLoad ommail

$ActionMailSMTPServer mail.domain.com
$ActionMailFrom rsyslog@domain.com
$ActionMailTo me@domain.com

$template mailSubject,"Successful guacamole login on %hostname%"
$template mailBody,"User has logged in:\r\n\r\n%msg%"

$ActionMailSubject mailSubject

# Only send an email every 5 minutes
$ActionExecOnlyOnceEveryInterval 300
# This if/then must all be on one line
if $msg contains 'successfully authenticated' then :ommail:;mailBody


----

Other options are anything that monitors logs, like swatch, expect 
scripts, splunk, nagios and probably a million others can all do 
real-time alerting if you need.

--Caleb

On 4/21/20 9:05 PM, ivanmarcus wrote:
>
> Chris,
>
> I'm not aware of any current extension, or facility within Guacamole 
> to do this - although someone may come up and point something out!
>
> If it were me I'd use a variation of the WOL Python script I wrote for 
> Guacamole a while ago (as long as you didn't need to do this for too 
> many users - it'd get a bit tiresome to administer otherwise).
>
> The way this works presently is to continuously poll catalina.out for 
> a successful connection number and compare that to a list. If a match 
> occurs it generates the necessary magic packet.
>
> Using this as a base it wouldn't be difficult to alter the script to 
> use a standard Linux mail util to deliver mail in place of the magic 
> packet.
>
> The WOL script should be on the list but I'm happy to post it again if 
> need be.
>
>
> On 22/04/2020 2:35 p.m., Chris Lee wrote:
>>
>> Hi All,
>>
>> �
>>
>> Is it possible to send email notification when some users success 
>> logon the system?
>>
>> �
>>
>> Regards,
>>
>> Chris
>>
>> �
>>
>>
>>
>> This message and its attachment (if any) are strictly confidential 
>> and sent to the designated recipient(s) only. If you are not the 
>> intended recipient, please notify the sender by e-mail and delete 
>> this message and its attachment (if any) from your computer system 
>> immediately . Century City International Holdings Limited, Paliburg 
>> Holdings Limited, Regal Hotels International Holdings Limited, its 
>> respective related subsidiaries, associated companies and affiliates 
>> do not guarantee this message and its attachment (if any) are free of 
>> computer virus and would not accept any liability whatsoever arising 
>> from Internet transmission.
>

Re: Email Notification on Login

Posted by Mike Jumper <mi...@glyptodon.com>.
On Tue, Apr 21, 2020 at 9:05 PM ivanmarcus <iv...@yahoo.com.invalid>
wrote:

> Chris,
>
> I'm not aware of any current extension, or facility within Guacamole to do
> this - although someone may come up and point something out!
>

There is indeed no extension provided for doing this, but if interested in
the way to achieve it with an extension, you would implement an
AuthenticationProvider and provide an implementation of getUserContext()
which sends the email (or, more likely, queues an email to be sent). The
getUserContext() function is invoked after a user has successfully
authenticated:

http://guacamole.apache.org/doc/guacamole-ext/org/apache/guacamole/net/auth/AuthenticationProvider.html#getUserContext-org.apache.guacamole.net.auth.AuthenticatedUser-

Extending AbstractAuthenticationProvider would be the easiest way to do
this.

http://guacamole.apache.org/doc/guacamole-ext/org/apache/guacamole/net/auth/AbstractAuthenticationProvider.html

See the manual for how extension .jar files are structured and how
Guacamole would be pointed at the relevant AuthenticationProvider class
(via your extension's guac-manifest.json):

http://guacamole.apache.org/doc/gug/guacamole-ext.html#ext-file-format

- Mike

Re: Email Notification on Login

Posted by ivanmarcus <iv...@yahoo.com.INVALID>.
Chris,

I'm not aware of any current extension, or facility within Guacamole to 
do this - although someone may come up and point something out!

If it were me I'd use a variation of the WOL Python script I wrote for 
Guacamole a while ago (as long as you didn't need to do this for too 
many users - it'd get a bit tiresome to administer otherwise).

The way this works presently is to continuously poll catalina.out for a 
successful connection number and compare that to a list. If a match 
occurs it generates the necessary magic packet.

Using this as a base it wouldn't be difficult to alter the script to use 
a standard Linux mail util to deliver mail in place of the magic packet.

The WOL script should be on the list but I'm happy to post it again if 
need be.


On 22/04/2020 2:35 p.m., Chris Lee wrote:
>
> Hi All,
>
> Is it possible to send email notification when some users success 
> logon the system?
>
> Regards,
>
> Chris
>
>
>
> This message and its attachment (if any) are strictly confidential and 
> sent to the designated recipient(s) only. If you are not the intended 
> recipient, please notify the sender by e-mail and delete this message 
> and its attachment (if any) from your computer system immediately . 
> Century City International Holdings Limited, Paliburg Holdings 
> Limited, Regal Hotels International Holdings Limited, its respective 
> related subsidiaries, associated companies and affiliates do not 
> guarantee this message and its attachment (if any) are free of 
> computer virus and would not accept any liability whatsoever arising 
> from Internet transmission.