Forum: Cfengine Help
Subject: Re: How to test the sending of cfengine mails?
Author: ro
Link to topic: https://cfengine.com/forum/read.php?3,20173,20174#msg-20174

Since I couldn't find anything built in, the following should at least emulate 
the desired behavior:


#####################################################################
#
# promises.cf
#
#####################################################################

body common control {
        any::
                bundlesequence  => { testmail };
}

body agent control {
        any::
                ifelapsed => "0";
}

body executor control {
        any::
                schedule => { 
"Min00","Min01","Min02","Min03","Min04","Min05","Min06","Min07","Min08","Min09","Min10","Min11","Min12","Min13","Min14","Min15","Min16","Min17","Min18","Min19","Min20","Min21","Min22","Min23","Min24","Min25","Min26","Min27","Min28","Min29","Min30","Min31","Min32","Min33","Min34","Min35","Min36","Min37","Min38","Min39","Min40","Min41","Min42","Min43","Min44","Min45","Min46","Min47","Min48","Min49","Min50","Min51","Min52","Min53","Min54","Min55","Min56","Min57","Min58","Min59"
 };
                mailfrom => "cfeng...@example.org";
                mailto => "r...@example.org";
                smtpserver => "192.168.0.1";
                mailmaxlines => "1000";
                exec_command => "$(sys.workdir)/bin/cf-agent";
}

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

bundle agent testmail {
reports:
        Yr2011:: "This is a dummy report issued at $(sys.date).";
}


Cheers,
Robert

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

Reply via email to