3.1.1 Grouping Data Using Prometheus
What
In order to do summary reporting, we need to leverage the power of Prometheus.
When/Why
Anytime we want to do something like report on a rollout or general status, we are going to want to summarize a report. We will accomplish this by using a Prometheus config file on the FileWave server itself.
How
The configuration (or yml files) that we'll create will always be placed in the /usr/local/etc/filewave/prometheus/conf.d/jobs/https directory on the FileWave server. Anything placed in this directory will automatically be read by Prometheus, and the data presented to our dashboard. (Example yml files can be found in /usr/local/etc/filewave/prometheus/conf.d/jobs)
The syntax of these files is quite picky, so it is best to copy an existing one, and then modify it. It may seem complicated, but we are always going to do the following steps:
* The inventory query (report) to use
* The field you want to count by...device_id is almost always a good one if reporting by device
* The field you want summarize (aggregate) by...in this case, the filewave client version 3. Once your report is created, the report id to use is most easily accessed through the webadmin. Note that the fields you want to use for aggregation must be in the report.
bash<br>curl -s -k -H "Authorization: <Base64_API_Token>" https://<my.server.address>:20445/inv/api/v1/query/<report_id> | python -mjson.tool<br>Make sure and substitute in your values for the <Base64_API_Token>, <my.server.address> and <report_id>
You'll get a response that includes the component and the field names as shown at right
Within a minute or two of creation of the file, the data should be available in your dashboard for a new panel.