#######################################################
#
# Set a class if a process does exist, more complex matches
#
#######################################################

body common control
{
      inputs => { "../../default.cf.sub" };
      bundlesequence  => { default("$(this.promise_filename)") };
      version => "1.0";
}

#######################################################

bundle agent init
{
  vars:
      "dummy" string => "dummy";
}

#######################################################

bundle agent test
{
  processes:
      ".*"
      process_select => test_select_high_users,
      classes => test_set_class("found", "not_found");
}

body classes test_set_class(t,f)
{
      promise_kept => { "$(t)" };
      promise_repaired => { "$(t)" };
      repair_failed => { "$(f)" };
}

body process_select test_select_high_users
{
      ttime_range => irange(0, accumulated(9,0,0,0,0,0));        # Anything
      process_result => "!ttime";                                # Nothing
}


#######################################################

bundle agent check
{
  classes:
      "ok" expression => "found.!not_found";        # Nothing found is "kept"

  reports:
    ok::
      "$(this.promise_filename) Pass";
    !ok::
      "$(this.promise_filename) FAIL";
}

### PROJECT_ID: core
### CATEGORY_ID: 30
