Sending Mail from puppet master !!!

53 views
Skip to first unread message

Rakesh Kathpal

unread,
Feb 20, 2014, 3:46:42 AM2/20/14
to puppet...@googlegroups.com
Hi,

The functionality that I am trying to achieve is

Step 1: Running a command / script triggered by a puppet run on the client
Step 2: Gathering the output of script
Step 3: Send the output via email to external source

Please note here, I am not sure about email settings on the client, so I would need the email to be sent out from the master and the output here is not a puppet run report but an output from my script that has executed on the client.

I understand that I am expecting something which is not a core puppet deliverable but I strongly believe that this can be achieved via puppet.

In case we are not able to send email, if we can atleast carry the output to the master by any chance...

Awaiting any suggestions / hacks ....

Thanks & Regards,

Rakesh K.

Johan De Wit

unread,
Feb 20, 2014, 4:04:20 AM2/20/14
to puppet...@googlegroups.com
Hi,

http://docs.puppetlabs.com/references/latest/report.html#tagmail

If you can get the output in execution report on your node, you could
use the tagmail configuration on the master to send email to the right
resource.

That's the first place I would look at for a possible solution

Grts

Johan
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAEJrXMVwEOg%3DnKaURxOzecisEJcy847xRnqjkNmiaDPGEjJLoA%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.


--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer (805008667232363)
Puppet Certified Professional 2013 (PCP0000006)
_________________________________________________________

Open-Future Phone +32 (0)2/255 70 70
Zavelstraat 72 Fax +32 (0)2/255 70 71
3071 KORTENBERG Mobile +32 (0)474/42 40 73
BELGIUM http://www.open-future.be
_________________________________________________________


Next Events:
Zabbix Certified Training | http://www.open-future.be/zabbix-certified-training-10-till-12th-march
Zabbix for Large Environments Training | http://www.open-future.be/zabbix-large-environments-training-13-till-14th-march
Puppet Intruction Course | http://www.open-future.be/puppet-introduction-course-14th-april
Puppet Advanced Training | http://www.open-future.be/puppet-advanced-training-15-till-17th-april
Subscribe to our newsletter | http://eepurl.com/BUG8H

Rakesh Kathpal

unread,
Feb 20, 2014, 4:21:25 AM2/20/14
to puppet...@googlegroups.com
Johan,

Thanks for your reply.

I had tried to explore this option but it seems, the report/output that is generated is only related and limited to the puppet run. Even for the script / command that I will be running via puppet, the report just contains whether it was successfully executed or not, I do not get the details output of the script.

- Rakesh K.


On Thu, Feb 20, 2014 at 2:34 PM, Johan De Wit <Jo...@open-future.be> wrote:
Hi,

http://docs.puppetlabs.com/references/latest/report.html#tagmail

If you can get the output in execution report on your node, you could use the tagmail configuration on the master to send email to the right resource.

That's the first place I would look at for a possible solution

Grts

Johan





On 02/20/2014 09:46 AM, Rakesh Kathpal wrote:
Hi,

The functionality that I am trying to achieve is

Step 1: Running a command / script triggered by a puppet run on the client
Step 2: Gathering the output of script
Step 3: Send the output via email to external source

Please note here, I am not sure about email settings on the client, so I would need the email to be sent out from the master and the output here is not a puppet run report but an output from my script that has executed on the client.

I understand that I am expecting something which is not a core puppet deliverable but I strongly believe that this can be achieved via puppet.

In case we are not able to send email, if we can atleast carry the output to the master by any chance...

Awaiting any suggestions / hacks ....

Thanks & Regards,

Rakesh K.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.


--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer         (805008667232363)
Puppet Certified Professional 2013 (PCP0000006)
_________________________________________________________
 Open-Future                 Phone     +32 (0)2/255 70 70
Zavelstraat 72              Fax       +32 (0)2/255 70 71
3071 KORTENBERG             Mobile    +32 (0)474/42 40 73
BELGIUM                     http://www.open-future.be
_________________________________________________________
 
Next Events:
Zabbix Certified Training | http://www.open-future.be/zabbix-certified-training-10-till-12th-march
Zabbix for Large Environments Training | http://www.open-future.be/zabbix-large-environments-training-13-till-14th-march
Puppet Intruction Course | http://www.open-future.be/puppet-introduction-course-14th-april
Puppet Advanced Training | http://www.open-future.be/puppet-advanced-training-15-till-17th-april
Subscribe to our newsletter | http://eepurl.com/BUG8H
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/5305C514.3090709%40open-future.be.

Johan De Wit

unread,
Feb 20, 2014, 4:41:59 AM2/20/14
to puppet...@googlegroups.com
Hi Rakesh,

I was afraid of that :)

Have you looked at the exec attribute

- **logoutput**
    Whether to log command output in addition to logging the
    exit code.  Defaults to `on_failure`, which only logs the output
    when the command has an exit code that does not match any value
    specified by the `returns` attribute.  In addition to the values
    below, you may set this attribute to any legal log level.
    Valid values are `true`, `false`, `on_failure`.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.


--
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer         (805008667232363)
Puppet Certified Professional 2013 (PCP0000006)
_________________________________________________________
 Open-Future                 Phone     +32 (0)2/255 70 70
Zavelstraat 72              Fax       +32 (0)2/255 70 71
3071 KORTENBERG             Mobile    +32 (0)474/42 40 73
BELGIUM                     http://www.open-future.be
_________________________________________________________
 
Next Events:
Zabbix Certified Training | http://www.open-future.be/zabbix-certified-training-10-till-12th-march
Zabbix for Large Environments Training | http://www.open-future.be/zabbix-large-environments-training-13-till-14th-march
Puppet Intruction Course | http://www.open-future.be/puppet-introduction-course-14th-april
Puppet Advanced Training | http://www.open-future.be/puppet-advanced-training-15-till-17th-april
Subscribe to our newsletter | http://eepurl.com/BUG8H


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAEJrXMW4dTuvnYdEFzv-euSmy0bGPQyTJo1y2k19tF0DaZN1Pg%40mail.gmail.com.

For more options, visit https://groups.google.com/groups/opt_out.


-- 
Johan De Wit

Open Source Consultant

Red Hat Certified Engineer         (805008667232363)
Puppet Certified Professional 2013 (PCP0000006)
_________________________________________________________
 
Open-Future                 Phone     +32 (0)2/255 70 70
Zavelstraat 72              Fax       +32 (0)2/255 70 71
3071 KORTENBERG             Mobile    +32 (0)474/42 40 73
BELGIUM                     http://www.open-future.be
_________________________________________________________
 

Upcoming Events:

Martin Alfke

unread,
Feb 20, 2014, 4:43:13 AM2/20/14
to puppet...@googlegroups.com
Hi,
On 20 Feb 2014, at 10:21, Rakesh Kathpal <rkat...@gmail.com> wrote:

> Johan,
>
> Thanks for your reply.
>
> I had tried to explore this option but it seems, the report/output that is generated is only related and limited to the puppet run. Even for the script / command that I will be running via puppet, the report just contains whether it was successfully executed or not, I do not get the details output of the script.

Is the script executed using exec resource type?
The exec resource can be configured to generate log output.
http://docs.puppetlabs.com/references/latest/type.html#exec-attributes

logoutput => # Whether to log command output in addition to…

hth,

Martin


>
> - Rakesh K.
>
>
> On Thu, Feb 20, 2014 at 2:34 PM, Johan De Wit <Jo...@open-future.be> wrote:
> Hi,
>
> http://docs.puppetlabs.com/references/latest/report.html#tagmail
>
> If you can get the output in execution report on your node, you could use the tagmail configuration on the master to send email to the right resource.
>
> That's the first place I would look at for a possible solution
>
> Grts
>
> Johan
>
>
>
>
>
> On 02/20/2014 09:46 AM, Rakesh Kathpal wrote:
> Hi,
>
> The functionality that I am trying to achieve is
>
> Step 1: Running a command / script triggered by a puppet run on the client
> Step 2: Gathering the output of script
> Step 3: Send the output via email to external source
>
> Please note here, I am not sure about email settings on the client, so I would need the email to be sent out from the master and the output here is not a puppet run report but an output from my script that has executed on the client.
>
> I understand that I am expecting something which is not a core puppet deliverable but I strongly believe that this can be achieved via puppet.
>
> In case we are not able to send email, if we can atleast carry the output to the master by any chance...
>
> Awaiting any suggestions / hacks ....
>
> Thanks & Regards,
>
> Rakesh K.
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAEJrXMVwEOg%3DnKaURxOzecisEJcy847xRnqjkNmiaDPGEjJLoA%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> Johan De Wit
>
> Open Source Consultant
>
> Red Hat Certified Engineer (805008667232363)
> Puppet Certified Professional 2013 (PCP0000006)
> _________________________________________________________
> Open-Future Phone +32 (0)2/255 70 70
> Zavelstraat 72 Fax +32 (0)2/255 70 71
> 3071 KORTENBERG Mobile +32 (0)474/42 40 73
> BELGIUM http://www.open-future.be
> _________________________________________________________
>
> Next Events:
> Zabbix Certified Training | http://www.open-future.be/zabbix-certified-training-10-till-12th-march
> Zabbix for Large Environments Training | http://www.open-future.be/zabbix-large-environments-training-13-till-14th-march
> Puppet Intruction Course | http://www.open-future.be/puppet-introduction-course-14th-april
> Puppet Advanced Training | http://www.open-future.be/puppet-advanced-training-15-till-17th-april
> Subscribe to our newsletter | http://eepurl.com/BUG8H
>
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAEJrXMW4dTuvnYdEFzv-euSmy0bGPQyTJo1y2k19tF0DaZN1Pg%40mail.gmail.com.

Rakesh Kathpal

unread,
Feb 20, 2014, 5:54:05 AM2/20/14
to puppet...@googlegroups.com
Looks good..

Tks a lot Johan & Martin..


On Thu, Feb 20, 2014 at 3:13 PM, Martin Alfke <tux...@gmail.com> wrote:
Hi,
On 20 Feb 2014, at 10:21, Rakesh Kathpal <rkat...@gmail.com> wrote:

> Johan,
>
> Thanks for your reply.
>
> I had tried to explore this option but it seems, the report/output that is generated is only related and limited to the puppet run. Even for the script / command that I will be running via puppet, the report just contains whether it was successfully executed or not, I do not get the details output of the script.

Is the script executed using exec resource type?
The exec resource can be configured to generate log output.
http://docs.puppetlabs.com/references/latest/type.html#exec-attributes

logoutput   => # Whether to log command output in addition to...
Reply all
Reply to author
Forward
0 new messages