Forum: CFEngine Help
Subject: Re: Reporting
Author: tjavo87
Link to topic: https://cfengine.com/forum/read.php?3,24824,24837#msg-24837

tjavo87 Wrote:
-------------------------------------------------------
> Thanx for the replies!
> 
> I'll investigate more time in the classes.
> 
> There is one more question about reporting. 
> 
> When running a command like /bin/ls, the output is
> shown when running cf-agent -v. Is it possible
> to redirect the output of that promise to a file?
> (reports:)
> Like the way I do in the promise about smb.
> 
> Maybe in combination with a class?
> 
> Thanx & Regards

I already figure this out by myself.


bundle agent yumupdate
{

commands:

vars:

 Sunday.test::

  "result" string => execresult("/usr/bin/yum check-update","noshell");

reports:

 Sunday.test::

  "$(sys.date) The following updates are available: 
    $(result)"

    report_to_file => "/var/cfengine/reports/$(sys.host)/yumupdate";

}


Suggestions are always welcome.

Regards

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

Reply via email to