Ask Your Question

Can I stop an exec from being classed as a change?

asked 2013-09-06 04:05:03 -0600

Simon gravatar image

updated 2013-09-12 01:00:24 -0600

golja gravatar image

I have a class that execs a script that in turn sends a passive check to a nagios/opsview server. This confirms if puppet has run ok.

class opsview_notify{
  exec { "/app/nrpe/bin/ puppet 0 OK":
    loglevel  => "info",
    logoutput => "on_failure",

The Opsview server then alerts if it has not received this update within 1 hour.

As this class does not change any configuration, I was wondering if there is a way that I could prevent Puppet from seeing this as a change?

Foreman/Puppet Dashboard both report this as a change which makes it impossible to spot when ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-09-06 08:26:55 -0600

jonuwz gravatar image

updated 2013-09-06 08:27:40 -0600

hack ..

class opsview_notify{
  exec { " puppet 0 OK":
   command   =>  '/bin/true'
   unless        => "/app/nrpe/bin/ puppet 0 OK"
   loglevel  => "info",
   logoutput => "on_failure",

if always succeeds, you'll never see a change.

edit flag offensive delete link more


Excellent. I'll give that a try. Many thanks.

Simon gravatar imageSimon ( 2013-09-09 07:38:02 -0600 )edit

Works great. Thanks again.

Simon gravatar imageSimon ( 2013-09-09 08:06:30 -0600 )edit

answered 2013-09-06 05:00:29 -0600

golja gravatar image

The reports output can definitely differentiate between a successfully run, but also if there were any changes made.

For example the puppet enterprise console shows you also the outcome of the report which can be; failed, unchanged, changed.

One way to do it in a more sophisticated way is to write an custom made report handler which will analyse the YAML output and if there are changes you can trigger a different alert to the Opsview. Have a look at the metrics -> values -> changed value in the YAML report.

For furher reading

edit flag offensive delete link more


Many thanks for the info. I'll take a look.

Simon gravatar imageSimon ( 2013-09-06 05:11:01 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-09-06 04:05:03 -0600

Seen: 1,020 times

Last updated: Sep 06 '13