Forum: CFEngine Help
Subject: Reporting promises not kept in Community Edition
Author: crd
Link to topic: https://cfengine.com/forum/read.php?3,23601,23601#msg-23601

I've been trying for a few days now to find a way in which to generate some 
kind of report when promises are not kept. We only have around 10 machines that 
we hope to deploy cfengine to, so our plan is to have reports of broken 
promises emailed straight to us.

I don't particularly care what form these reports take, but I can't seem to 
find a way to get a "promises not kept" report out of cf-report. I tried an 
approach of assigning a class to reflect the promise outcome:

bundle agent testbundle {
files:
        "testfile.txt"
                classes         =>      cdefine(
                        "mode_kept",
                        "mode_repaired",
                        "mode_failed"
                );
reports:
        mode_failed::
                "promise failed";       
        mode_kept::
                "promise kept";
        mode_repaired::
                "promise repaired";             
}
body classes cdefine(k,r,f){
        promise_kept => {canonify("${k}")};
        promise_repaired => {canonify("${r}")};
        repair_failed => {canonify("${f}")};
}


This works for a single promise, but the class persists so if I have a second 
promise using the same structure, the report will be generated again.

Any suggestions on how I can get any sort of reporting of broken promises?

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

Reply via email to