-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make all results from amps plugins exportable #2394
Comments
Hi @amard33p what is the output format of /usr/local/bin/mycommand.sh (when it ran from the command line) ? |
@nicolargo Here's an example:
Output: Again, this is just my idea...we can discuss on a more optimal output format. |
Ok i understand, let me reformulate: you want a way to configure AMP plugin output in order to export it in a key=value format. I propose to implement the following behavors: Output format of the AMP script is a JSON Ex: output of myamp2.sh
Glances configuration file:
Expected output CSV for the AMP plugin:
Note: another fields will also be added as meta data for the AMP. Output format of the AMP script is a CSV Ex: output of myamp1.sh
Glances configuration file:
Expected output CSV for the AMP plugin:
Note: another fields will also be added as meta data for the AMP. Additional information Just for the record, what you want to do in your amp_conntrack example already exist as a non AMP plugin:
|
@nicolargo Overall I do like your idea to specify the output format but wanted to point out that outputting JSON in bash is not straightforward. This is the easiest way I found. We should mention this in the docs when the feature becomes available. Also I used the amp_conntrack just as an example...glad to know it's supported natively. |
First part of the job done on the issue2394 branch. AMPs export is enable. Not the behavor regarding the AMPs script output. |
Test bed:
Works in progress in branch issue2394. |
Merged into develop. All plugins are now exportable. Note: for CSV export, header field now include the plugin name (ex: cpu.total). Please test the develop version @amard33p |
Ref issue: #1556
Currently amps plugins are not exportable:
glances/glances/exports/glances_export.py
Lines 26 to 31 in 13f6db0
At work we require lot of custom metrics and AMPs are great for that usecase. It would be great if we could export the results of AMP scripts.
Here's the proposal:
A single AMP script may export single or multiple metrics.
For a single metric, the output CSV should only contain the column amps_AMP_name_result.
Example:
Expected output CSV:
Now if the AMP script result contains multiple fields, it needs to output those fields in a predefined format.
Example format:
value_1,100;value_2,400
To implement this we can probably create a new attribute for AMP like
result_fields
. Example:Expected output CSV:
The text was updated successfully, but these errors were encountered: