Forum: CFEngine Help
Subject: Re: Question on cf-execd duplicate report suppression
Author: ro
Link to topic: https://cfengine.com/forum/read.php?3,27134,27546#msg-27546

Okay, a few weeks ago I did some small test setup on one of the machines:


bundle agent duplicateReportTest {
commands:
        SRV_DUP_TEST::
                "/bin/uname -r";
}


which yielded the following report:


Q: ".../bin/uname -r": 2.6.32-38-generic
I: Last 1 quoted lines were generated by promiser "/bin/uname -r"


And from running this for some time, I can confirm that duplicate report seem 
to be suppressed either forever or for a very long time.

And yes, it is true that duplicate report suppression can be reset by deleting 
the 'previous' symlink in the /var/cfengine/outputs folder. So, if required, a 
small promise ensures that persisting problem reports are not forgotten:


bundle agent CfengineConfig {
vars:
        SV_CFENGINE::
                "outputs_dir" string    => "$(sys.workdir)/outputs";
                "files" slist           => { "previous" };
files:
        SV_CFENGINE.Hr00_Q1::
                "$(outputs_dir)/"
                        delete          => tidy,
                        file_select     => by_name("@(CfengineConfig.files)"),
                        depth_search    => recurse("1"),
                        action          => one_day_delay,
                        comment         => "Delete the 'previous' log file in 
order to avoid permanent cf-execd duplicate report suppression";
}


This resets all supression each day at midnight.

BTW, upon establishing the above snippet I indeed detected a problem on one of 
the machines that somehow slipped by :-)

Perhaps a more generic option would tackle this problem in a more general 
manner? Something along the lines of:


body executor control {
        ...
        resetreportsuppression_after    => "24"; # in hours
        ...
}


Cheers,

Robert

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to