Forum: CFEngine Help
Subject: Re: cf-report, I need help with it
Author: bbomgardner
Link to topic: https://cfengine.com/forum/read.php?3,22700,22707#msg-22707

I can't give any advice on cf-report, but here's an idea that I took from a few 
others in this forum which could be an easy solution until you can get 
cf-report to do what you need.

1. Write a cfengine promise to generate some kind of a report (csv, xml, 
whatever) using some of the built-in sys variables
2. Have one variable contain the last line or so of the promise_summary log 
using execresult
3. Setup a webdav server somewhere allowing puts and use the curl command to 
send this file up to after it has been repaired
ie:

files:

  "$(tiny_rpt)"
    handle          =>    "tiny_rpt",
    comment         =>    "Create file to send to policy host for (basic) 
central reporting.",
    create          =>    "true",
    edit_defaults   =>    h_empty,
    edit_line       =>    h_append_if_no_line("$(xml)"),
    classes         =>    h_if_repaired("upload_file");

commands:

  upload_file::
    "/usr/bin/curl -T $(tiny_rpt) http:// $(heartbeat_global.phost)/drop/ -o 
/dev/null -s"
       handle        =>   "upload_file_to_phost",
       comment       =>   "Use curl to upload file to central webdav for parse 
and display.";



Now from a central location you can find out the last time a client checked in 
(by the file mtime) as well as the last promise summary information.

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

Reply via email to