Snapshot Reports
We want a way for the UI to be able to let a user request the log files and configuration settings for a particular resource (first implementation will be for the Jopr Agent and Jopr Server). We need this to be generic enough for this to be applicable to other managed resources (Tomcat, Postgres, Oracle, etc).
In addition, it would be cool for the snapshot data to be passed through an analysis tool to help detect problems and suggest possible solutions.
Agent Plugin Facet
SnapshotReportFacet could look like this:
public interface SnapshotReportFacet {
InputStream getSnapshotReport(String name, String description, Configuration snapshotConfiguration);
}
I originally thought we need a <snapshot-report> element, but I don't think we need to have that. Maybe?
There will need to be a new SnapshotReportManager in the plugin container. It will simply expose its API as a remote POJO API so the server can call it:
public interface SnapshotReportManager {
InputStream getSnapshotReport(Resource resource, String name, String description, Configuration snapshotConfiguration);
}
The UI for now can be simple - in the Inventory tab we can have a subtab "Snapshot Report" that is shown only if the resource has one or more <snapshot-report> metadata elements (this is one reason we might need to have it - we need to have something in the data model so the server-side knows that it supports this, just like <operation> tells the server it supports the operation facet for example). The UI Inventory>SnapshotReport can look up the plugin descriptor, get the <snapshot-report> config elements for the resource, render the configuration (or just use the plugin configuration), let the user fill in the configuration, hit OK, that gets submitted to an SLSG "SnapshotReportManagerSLSB" which synchronously calls the agent. The server can slurp in the input stream, write the data somewhere (to disk, which won't support HA, or to DB will which) then pass back the location where the file was saved to the UI. Or we could immediately send the data to the UI by streaming it down. Or we can write the file to the rhq-downloads location and pass the URL to the server rhq-downloads page and let the user download it.
Server Side Analysis Plugin
We could optionally provide server-side analysis plugins that can be passed the snapshot report and the server-side plugin could analysis the report and spit out recommendations or findings about that report.