Foreman summary mail

3 views
Skip to first unread message

LOhit

unread,
Dec 17, 2009, 6:12:38 AM12/17/09
to puppet...@googlegroups.com
Hello,

I have enabled summary emails from foreman and set up a cron job which sends me periodic summary emails. However, the mail's content is sort of plain text. Now this is more like a feature request rather than a problem, I am wondering if we could use some kind of HTML template and pass the values through this HTML template and then mail the output as a summary email to the administrator.

In the HTML template we could perhaps play around highlighting failed nodes in "RED" and probably some graphs. etc..etc...

I remember doing this couple of years ago using perl and I used to get nice tabulated summary email of the output of my custom script(basically a log parser).

Best regards, 
LOhit

Ohad Levy

unread,
Dec 17, 2009, 6:49:39 AM12/17/09
to puppet...@googlegroups.com
On Thu, Dec 17, 2009 at 7:12 PM, LOhit <loh...@gmail.com> wrote:
Hello,

I have enabled summary emails from foreman and set up a cron job which sends me periodic summary emails. However, the mail's content is sort of plain text. Now this is more like a feature request rather than a problem, I am wondering if we could use some kind of HTML template and pass the values through this HTML template and then mail the output as a summary email to the administrator.
Its already in HTML, and its already using an ERB template*1 - it probably needs to be improved :)

In the HTML template we could perhaps play around highlighting failed nodes in "RED" and probably some graphs. etc..etc...

yeah, but most mail clients are blocking content from external web sites, so it might work (or not).
I remember doing this couple of years ago using perl and I used to get nice tabulated summary email of the output of my custom script(basically a log parser).
for future reference, you may want to open a feature request at http://theforeman.org

cheers,
Ohad

LOhit

unread,
Dec 17, 2009, 7:03:44 AM12/17/09
to puppet...@googlegroups.com
Hi Ohad,

Thanks for the quick reply. Yes I agree with you on, "most mail clients block content from external web sites", but it will still be nice to have this.

As for the patches, I am not much of a developer. But, I do write  perl/python scripts now and then to automate few of my day to day tasks.

However, I would definitely try and see if I can contribute in any way to add this feature. Hmm, need to learn ruby first :)

Best regards,
-LOhit

--

You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.



--
LOhit

Ohad Levy

unread,
Dec 17, 2009, 7:45:37 AM12/17/09
to puppet...@googlegroups.com
http://theforeman.org/issues/show/135

hopefully its a starting point

cheers,
Ohad

LOhit

unread,
Dec 17, 2009, 10:07:03 AM12/17/09
to puppet...@googlegroups.com
Yes, of course. Let's see how I fare. :)

Thanks
LOhit

LOhit

unread,
Dec 22, 2009, 4:11:56 AM12/22/09
to puppet...@googlegroups.com
Hello Ohad,

I have added some CSS to summary.erb file. And added content "text/html" to "host_mailer.rb". This seems to be working fine. And Outlook seems to be happy. I tried pasting the resulting HTML in W3C website and it passed without any errors.

I am attaching the file "summary.erb" file along with this email. I had to rename "summary.text.html.erb" to "summary.erb" for the CSS to work. Which is the expected behaviour.

Please see if this can be patched into the main repo.

PS: I am no developer, please feel free to point out any mistakes. I am willing to learn.

Best regards,
-LOhit
--
LOhit
summary.erb
Reply all
Reply to author
Forward
0 new messages