Hallo,
I was searching the term "mail" but couldnt find what I was looking for....
What about to add e-mail support to EG?
If there are error conditions detected by EG and shown in the log I would like to send (selected) alerts to my email (handy).
It would be ok with a script but an email plug-in would be great
Best regards, Walter
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
EG with e-mail support for error messages....
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: EG with e-mail support for error messages....
Bump
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: EG with e-mail support for error messages....
You should be able to send mail with a hand full lines of python code. I have a python script sending mail outside EG. I can test if it runs within EG.
But there is no special event for errors. There is no common behaviour on errors in the plugins.
I have thought about asking for a special eventtype for error too...
But there is no special event for errors. There is no common behaviour on errors in the plugins.
I have thought about asking for a special eventtype for error too...
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: EG with e-mail support for error messages....
Hallo Bartman,
Yes, this would be interesting to build something on.
In my case, and I believe others too, I run EG 24/7/365 and it would not be nice if it stops (I even have another software monitoring that EG is running...) and therefore it would be very important to know if for instance my script stops executing.
With your script for email it might be possible to do something like this;
Lets say you have a main script that is running (on timer or scheduler). The script also updates a counter or toggles a flag every time it executes. This flag is defined as an eg.global variabel.
Your mail script runs also on timer/scheduler and if it recognizes that the counter/flag has been the same for a couple of runs, it could send a mail.
Of course this only monitors your main script but its better then nothing...
Best regards
Yes, this would be interesting to build something on.
In my case, and I believe others too, I run EG 24/7/365 and it would not be nice if it stops (I even have another software monitoring that EG is running...) and therefore it would be very important to know if for instance my script stops executing.
With your script for email it might be possible to do something like this;
Lets say you have a main script that is running (on timer or scheduler). The script also updates a counter or toggles a flag every time it executes. This flag is defined as an eg.global variabel.
Your mail script runs also on timer/scheduler and if it recognizes that the counter/flag has been the same for a couple of runs, it could send a mail.
Of course this only monitors your main script but its better then nothing...
Best regards
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: EG with e-mail support for error messages....
Dear Bartman,
Have you made any tries regarding sending mail from EG?
Do you have a sample script you could publish?
BestR Walter
Have you made any tries regarding sending mail from EG?
Do you have a sample script you could publish?
BestR Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM
Re: EG with e-mail support for error messages....
I totally forgot about it.
Make sure you replace all the placeholders
Code: Select all
import smtplib
def mail(to, text, subject):
headers = "From: \"your name\" <[email protected]>To: %s\r\nSubject: %s\r\n\r\n" % (to, subject)
message = headers + text
mailServer = smtplib.SMTP("smtp.address.com")
mailServer.login("user", "password")
mailServer.sendmail("[email protected]", to, message)
mailServer.quit()
mail("recipient", "EG Test", "subject");-
krambriw
- Plugin Developer
- Posts: 2570
- Joined: Sat Jun 30, 2007 2:51 pm
- Location: Stockholm, Sweden
- Contact:
Re: EG with e-mail support for error messages....
Thanks a lot Bartman,
BestR Walter
BestR Walter
My released plugins
https://drive.google.com/drive/folders/ ... y01eVBKeHM
https://drive.google.com/drive/folders/ ... y01eVBKeHM