Re: [Puppet Users] Possible to exclude an event in Puppet dashboard?

2012-10-24 Thread Martin Willemsma
2012/10/22 Calvin Walton calvin.wal...@kepstin.ca

 On Mon, 2012-10-22 at 10:28 +0200, Martin Willemsma wrote:
  Hi All,
 
  I was wondering if it is possible to NOT show an event in puppet
 dashboard.
  I have an exec resource that fires of a ruby script. This is triggering a
  changed event on every run, but actually I want to exclude this from
  showing up as CHANGED
 
  Is this possible, if so how can I achieve this?

 There's actually a trick you can do with the 'onlyif' and 'unless'
 options to the exec type that can accomplish what you want. The expense
 is that you no longer get log output from the command on failure:

 exec {
 run_myscript :
 unless = /usr/bin/env ruby ${my_script} ${csv_files},
 command = /bin/false,
 cwd = ${myscript_dir},
 timeout = 0,
 logoutput = on_failure,
 }

 (This will show up as an error in the puppet run if the command fails,
 but not show up at all if it succeeds.)

 However, you mentioned something about facts generation in a later post?
 Do keep in mind that facts are uploaded to the puppet master *before*
 any of the code in your manifest executes, so anything done in your
 manifest will only affect the facts for the next puppet run.

 --
 Calvin Walton calvin.wal...@kepstin.ca




Thank for this suggestion Calvin,

I'm uploading facts to the inventory as part of this manifest.

I have a bunch of files I want to monitor. This can be random files. I
created a small script in ruby to check the existence of those files and
check the current md5sum. If the sum is not in my log, or the file has been
added to the list of files that need to be monitored, that file is being
send to the puppet filebucket and the file plus sum is added as a customer
fact.

The last step in my script will do a `puppet facts upload  --terminus
inventory_service --mode agent` if any of the files has been changed. This
trick is here just for the reason you mentioned. The facts are 'known' to
others in the next run. I need this information directly.

Thanks again for your hint. Will be the first thing I try tomorrow.

-- 
Kind Regards,

Martin Willemsma

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



[Puppet Users] Possible to exclude an event in Puppet dashboard?

2012-10-22 Thread Martin Willemsma
Hi All,

I was wondering if it is possible to NOT show an event in puppet dashboard.
I have an exec resource that fires of a ruby script. This is triggering a
changed event on every run, but actually I want to exclude this from
showing up as CHANGED

Is this possible, if so how can I achieve this?

---
myscript:
---

exec {
run_myscript :
# run myscript
command = /usr/bin/env ruby ${my_script} ${csv_files},
cwd = ${myscript_dir},
timeout = 0,
logoutput = on_failure,
}

-- 
Regards,
Martin Willemsma

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



Re: [Puppet Users] Possible to exclude an event in Puppet dashboard?

2012-10-22 Thread Stephen Gran
Hi,

On Mon, 2012-10-22 at 10:28 +0200, Martin Willemsma wrote:
 Hi All, 
 
 I was wondering if it is possible to NOT show an event in puppet
 dashboard. I have an exec resource that fires of a ruby script. This
 is triggering a changed event on every run, but actually I want to
 exclude this from showing up as CHANGED 

The traditional way to have a script run periodically is to put
something in cron.  Puppet can help you with that.

Cheers,
-- 
Stephen Gran
Senior Systems Integrator - guardian.co.uk

Please consider the environment before printing this email.
--
Visit guardian.co.uk - newspaper of the year

www.guardian.co.ukwww.observer.co.uk www.guardiannews.com 

On your mobile, visit m.guardian.co.uk or download the Guardian
iPhone app www.guardian.co.uk/iphone and iPad edition www.guardian.co.uk/iPad 
 
Save up to 37% by subscribing to the Guardian and Observer - choose the papers 
you want and get full digital access. 
Visit guardian.co.uk/subscribe 

-
This e-mail and all attachments are confidential and may also
be privileged. If you are not the named recipient, please notify
the sender and delete the e-mail and all attachments immediately.
Do not disclose the contents to another person. You may not use
the information for any purpose, or store, or copy, it in any way.
 
Guardian News  Media Limited is not liable for any computer
viruses or other material transmitted with or as part of this
e-mail. You should employ virus checking software.

Guardian News  Media Limited

A member of Guardian Media Group plc
Registered Office
PO Box 68164
Kings Place
90 York Way
London
N1P 2AP

Registered in England Number 908396

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



Re: [Puppet Users] Possible to exclude an event in Puppet dashboard?

2012-10-22 Thread Martin Willemsma
2012/10/22 Stephen Gran stephen.g...@guardian.co.uk

 Hi,

 On Mon, 2012-10-22 at 10:28 +0200, Martin Willemsma wrote:
  Hi All,
 
  I was wondering if it is possible to NOT show an event in puppet
  dashboard. I have an exec resource that fires of a ruby script. This
  is triggering a changed event on every run, but actually I want to
  exclude this from showing up as CHANGED

 The traditional way to have a script run periodically is to put
 something in cron.  Puppet can help you with that.

 Cheers,
 --
 Stephen Gran
 Senior Systems Integrator - guardian.co.uk

 Please consider the environment before printing this email.
 --
 Visit guardian.co.uk - newspaper of the year

 www.guardian.co.ukwww.observer.co.uk www.guardiannews.com

 On your mobile, visit m.guardian.co.uk or download the Guardian
 iPhone app www.guardian.co.uk/iphone and iPad edition
 www.guardian.co.uk/iPad

 Save up to 37% by subscribing to the Guardian and Observer - choose the
 papers you want and get full digital access.
 Visit guardian.co.uk/subscribe

 -
 This e-mail and all attachments are confidential and may also
 be privileged. If you are not the named recipient, please notify
 the sender and delete the e-mail and all attachments immediately.
 Do not disclose the contents to another person. You may not use
 the information for any purpose, or store, or copy, it in any way.

 Guardian News  Media Limited is not liable for any computer
 viruses or other material transmitted with or as part of this
 e-mail. You should employ virus checking software.

 Guardian News  Media Limited

 A member of Guardian Media Group plc
 Registered Office
 PO Box 68164
 Kings Place
 90 York Way
 London
 N1P 2AP

 Registered in England Number 908396

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


Thank you Steven,

I'm aware of cron resources I also use them. This particular script is
creating a couple of custom facts, that I'm uploading to the
inventory_service  using puppet facts upload preferably I would like to
have in the same or right after the puppet run.

I was hoping to be able to specify a debug level to logging. ( to dashboard
)

Like debug = true

For now I will create a cron to fire off the script.

Thanks for your reply.

-- 
Kind Regards,

Martin Willemsma

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



Re: [Puppet Users] Possible to exclude an event in Puppet dashboard?

2012-10-22 Thread Calvin Walton
On Mon, 2012-10-22 at 10:28 +0200, Martin Willemsma wrote:
 Hi All,
 
 I was wondering if it is possible to NOT show an event in puppet dashboard.
 I have an exec resource that fires of a ruby script. This is triggering a
 changed event on every run, but actually I want to exclude this from
 showing up as CHANGED
 
 Is this possible, if so how can I achieve this?

There's actually a trick you can do with the 'onlyif' and 'unless'
options to the exec type that can accomplish what you want. The expense
is that you no longer get log output from the command on failure:

exec {
run_myscript :
unless = /usr/bin/env ruby ${my_script} ${csv_files},
command = /bin/false,
cwd = ${myscript_dir},
timeout = 0,
logoutput = on_failure,
}

(This will show up as an error in the puppet run if the command fails,
but not show up at all if it succeeds.)

However, you mentioned something about facts generation in a later post?
Do keep in mind that facts are uploaded to the puppet master *before*
any of the code in your manifest executes, so anything done in your
manifest will only affect the facts for the next puppet run.

-- 
Calvin Walton calvin.wal...@kepstin.ca


smime.p7s
Description: S/MIME cryptographic signature