Project

General

Profile

Mail Notifications » History » Revision 6

Revision 5 (Alexander Rusa, 02/25/2011 08:45 AM) → Revision 6/9 (Raffael Schmid, 01/05/2012 11:28 AM)

h1. Summarized E-Mail Reports 

 h2. Overview 

 Starting in version 0-1.3 Foreman can send a hourly / daily email report containing information about your nodes. 

 this information will include: List of hosts that had errors or that have performed any action through puppet. 
 additionally, it would include a list of all of your hosts which didn't run Puppet recently (defaults to 30 minutes). 

 h2. Configuration 

 First, make sure that you enable emails in Foreman - at the [[Email configuration]] page. 

 Secondly, you would need to setup a cron job: 

 Available options: 
  * days       => number of days to scan backwards (defaults to 1) 
  * hours      => number of hours to scan backwards (defaults to disabled) 

 Example: 
 <pre> 
   rake reports:summarize days=3 RAILS_ENV="production" # Sends out a summary email for the last 3 days. 
 </pre> 
 or 
 <pre> 
   rake reports:summarize hours=12 RAILS_ENV="production" # Sends out a summary email for the last 12 hours. 
 </pre> 

 h3. Recipients  

 If you are using LDAP authentication, Foreman will send the reports directly to all registered users, if that's not what you would like, add the following line to your *config/settings.yaml* file: 
 <pre> 
 #Foreman host, required for http links inside emails 
 :foreman_url: foreman.domain 
 # where do send out daily report emails, comment out if you want to send to registered Foreman users instead. 
 :administrator: ohadlevy@gmail.com 
 </pre> 

 h1. Emails on Report errors 

 Similar to tagmail, foreman can send you notifications once a report which contains an error has been received. 

 at this point of time, the report would be sent to a mailbox predefined in config/settings.yaml, however in future versions, the report would be sent only to the relevant user (or user group) which manage the host. 

 in order to enable please make sure the following two lines exists in your '''config/settings.yaml''' file: 
 <pre> 
 :administrator: <email address of recipient>  
 :failed_report_email_notification: true 
 </pre> 

 *Please note:* Foreman will not send notifications for reports which where generated by a puppet client < 2.6.5 and creating the catalog failed on the puppet master.