Re: Email notification pgAgent

From: Jasmin Dizdarevic <jasmin(dot)dizdarevic(at)gmail(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Email notification pgAgent
Date: 2011-07-14 23:02:55
Message-ID: CAOveQuPam3UWiq4qM+RC3DAUNodhM8G9-QKw_Q_i46FVAGHUag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Well...it took a long time, but the feature is done :)

A friend of mine wrote a C implementation of an smtp client and gave it to
me to include it into pgAgent.
It's a very basic smtp client, without authentication support. I think we're
going to include it, if needed.
There is another change in pgAgent. Now it's possible to execute an SQL
statement from a file located on a place, where pgAgent can access it. I've
included this feature, because we need it at work. We can exclude it, if
you're against it.

The second patch is the GUI for pgAdmin - email notification fields.
The mailer.c in pgAgent will need some tweaking because of possible double
includes (wxWidgets).

pgAgent version has to be 4 now.

Any comments are welcome.
Jasmin

2011/1/5 Jasmin Dizdarevic <jasmin(dot)dizdarevic(at)gmail(dot)com>

> First of all the agents check's if email is configured and writes this to
> the database (pga_jobagent).
> Older agent's won't run, if the schema version has changed. This is nothing
> new: Matching between PGAGENT_VERSION_MAJOR and pgagent.schema_version().
>
> For the User there are two scenarios:
> 1. Creating/Modifying job
> see screen1.png
>
> It will check, if the desired agents are configured for email. If "Host
> agent" is empty, it will check every host registered otherwise the selected
> host only.
> This check only applies, when you enable email notification - so there is
> no problem, when not using it.
>
> 2. The configuration changes after the job has been created with email
> notification
> see screen2.png
> In this case the configuratin status for this job will be shown in
> properties box. It's not possible to update the job, until email
> notification is disabled, configured or bound to an host agent, that is
> already configured properly.
>
> I'm relatively sure, that we will get the authorization, so I'm supposing
> that pgAgent 4 will be with SMTP support.
>
> Regards,
> Jasmin
>
> 2011/1/5 Dave Page <dpage(at)pgadmin(dot)org>
>
>> On Tue, Jan 4, 2011 at 10:33 PM, Jasmin Dizdarevic
>> <jasmin(dot)dizdarevic(at)gmail(dot)com> wrote:
>> > Hi Dave, i think we're on the right way to bear this baby ;)
>>
>> Well, that's one way of putting it :-)
>>
>> > I'm waiting for the authorization for jwsmtp now. When I get it, i will
>> > include the files into the source tree of pgAgent.
>>
>> Please ensure he CC's me with his authorisation, as I'll need to keep
>> a record of it.
>>
>> > The UI checks the schema version and disables/enables all related
>> features.
>> > I've also added an column to pgagent.pga_jobagent, that shows if
>> smtp-server
>> > on the host instance is configured.
>> > If the user creates or modifies a job where email notification is
>> enabled,
>> > he will get a message, that it won't work.
>>
>> How does that work with multiple agents? Don't forget, one of our
>> supported configurations is having agents running on multiple machines
>> against the same database, so we'd need to allow for the case where a
>> user has some agents with SMTP support and some without.
>>
>> Though of course, if we get permission to incorporate the code into
>> pgagent under the appropriate licence, then that is irrelevant as
>> we'll be able to safely enable email in all cases, and rely on the
>> schema version to ensure agents are compatible.
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>
>

Attachment Content-Type Size
0003-Added-GUI-for-email-notification-in-dlgJob-and-file-.patch application/octet-stream 17.5 KB
0001-Email-notification-for-jobs-and-SQL-execution-from-f.patch application/octet-stream 29.1 KB

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Ashesh Vashi 2011-07-15 05:29:08 Re: pgAdmin III commit: Database Designer (milestone 1 of GSoC 2011)
Previous Message Guillaume Lelarge 2011-07-14 21:34:01 pgAdmin III commit: XRC updates, and make style