Closed IzabellaRaulin closed 7 years ago
Fixes https://github.com/intelsdi-x/snap-plugin-collector-interface/issues/13
load snap-plugin-collector-interface:
snaptel plugin load snaptel plugin load ./build/linux/x86_64/snap-plugin-collector-interface
create task manifest with a specified dynamic element (interface), see examples/tasks/:
{ "version": 1, "schedule": { "type": "simple", "interval": "1s" }, "workflow": { "collect": { "metrics": { "/intel/procfs/iface/eno1/*": {} }, "publish": [ { "plugin_name": "file", "config": { "file": "/tmp/published_interface_eno1" } }, { "plugin_name": "influxdb", "config": { "host": "127.0.0.1", "port": 8086, "database": "snap", "user": "admin", "password": "admin" } } ] } } }
load declared publishers: snap-plugin-publisher-influxdb and snap-plugin-publisher-file:
snaptel plugin load snaptel plugin load <path-to-snap-plugin-publisher-influxdb> snaptel plugin load snaptel plugin load <path-to-snap-plugin-publisher-file>
create a task:
$ snaptel task create -t examples/tasks/iface_eno1-file_influxdb.json
Using task manifest to create task Task created ID: 72166b3e-4236-46ef-89f1-a9088441f113 Name: Task-72166b3e-4236-46ef-89f1-a9088441f113 State: Running
5. watch collected metrics: (notice, that they comes only from specified interface `eno1`)
$ snaptel task watch 72166b3e-4236-46ef-89f1-a9088441f113
Watching Task (72166b3e-4236-46ef-89f1-a9088441f113): NAMESPACE DATA TIMESTAMP /intel/procfs/iface/eno1/bytes_recv 1.8418728438e+10 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/bytes_sent 2.8270863484e+10 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/compressed_recv 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/compressed_sent 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/drop_recv 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/drop_sent 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/errs_recv 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/errs_sent 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/fifo_recv 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/fifo_sent 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/frame_recv 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/frame_sent 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/multicast_recv 7.156362e+06 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/multicast_sent 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/packets_recv 3.5404287e+07 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/packets_sent 3.379646e+07 2016-12-01 14:22:55.672502653 +0100 CET
:+1:
Fixes https://github.com/intelsdi-x/snap-plugin-collector-interface/issues/13
Summary of changes:
How to verify it:
Example:
load snap-plugin-collector-interface:
create task manifest with a specified dynamic element (interface), see examples/tasks/:
load declared publishers: snap-plugin-publisher-influxdb and snap-plugin-publisher-file:
create a task:
Using task manifest to create task Task created ID: 72166b3e-4236-46ef-89f1-a9088441f113 Name: Task-72166b3e-4236-46ef-89f1-a9088441f113 State: Running
$ snaptel task watch 72166b3e-4236-46ef-89f1-a9088441f113
Watching Task (72166b3e-4236-46ef-89f1-a9088441f113): NAMESPACE DATA TIMESTAMP /intel/procfs/iface/eno1/bytes_recv 1.8418728438e+10 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/bytes_sent 2.8270863484e+10 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/compressed_recv 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/compressed_sent 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/drop_recv 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/drop_sent 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/errs_recv 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/errs_sent 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/fifo_recv 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/fifo_sent 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/frame_recv 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/frame_sent 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/multicast_recv 7.156362e+06 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/multicast_sent 0 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/packets_recv 3.5404287e+07 2016-12-01 14:22:55.672502653 +0100 CET /intel/procfs/iface/eno1/packets_sent 3.379646e+07 2016-12-01 14:22:55.672502653 +0100 CET