Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-179

cf-agent / cf-runagent should exit with non-zero error code if at least one promises if failed to be kept/repaired

    XMLWordPrintable

    Details

      Description

      cf-agent / cf-runagent should exit with non-zero error code if at least one promise is failed to be kept or repaired.

      This would give administrator the exact status of whole environment without the need for further auditing.
      Also this will allow the use of cf-agent and cf-runagent in some other scripts that check the status of system.

      Workarounds

      Inspect the last line of the verbose output

       verbose: Outcome of version (not specified) (agent-0): Promises observed - Total promise compliance: 50% kept, 0% repaired, 50% not kept (out of 2 events
      ). User promise compliance: 50% kept, 0% repaired, 50% not kept (out of 2 events). CFEngine system compliance: 0% kept, 0% repaired, 0% not kept (out of 0
       events).    
      

      Inspect the promise_summary.log at the end of the agent run

      1542385430,1542385433: Outcome of version CFEngine Promises.cf 3.10.5 (agent-0): Promises observed - Total promise compliance: 100% kept, 0% repaired, 0% 
      not kept (out of 5854 events). User promise compliance: 100% kept, 0% repaired, 0% not kept (out of 1577 events). CFEngine system compliance: 100% kept, 0
      % repaired, 0% not kept (out of 4277 events).   
      

      Instrument policy to leave traces for inspection post agent run

      There are many different ways to accomplish this, a few tactics that might be useful:

      • default bodies
      • action body logging
      • reports promises with report_to_file

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rprots Roman Prots
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel