diff --git a/README.md b/README.md index 34c3171..9c0447f 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Snap plugin intended to process data and return statistics over a sliding window ### Installation #### Download plugin binary: -You can get the pre-built binaries for your OS and architecture from the plugin's [GitHub Releases](https://github.com/intelsdi-x/snap-plugin-processor-statistics/releases) page. Download the plugin from the latest release and load it into `snapd` (`/opt/snap/plugins` is the default location for Snap packages). +You can get the pre-built binaries for your OS and architecture from the plugin's [GitHub Releases](https://github.com/intelsdi-x/snap-plugin-processor-statistics/releases) page. Download the plugin from the latest release and load it into `snapteld` (`/opt/snap/plugins` is the default location for Snap packages). #### To build the plugin binary: Fork https://github.com/intelsdi-x/snap-plugin-processor-statistics @@ -63,7 +63,7 @@ Documentation for Snap collector psutil plugin can be found [here](https://githu In one terminal window, open the Snap daemon : ``` -$ snapd -t 0 -l 1 +$ snapteld -t 0 -l 1 ``` The option "-l 1" it is for setting the debugging log level and "-t 0" is for disabling plugin signing. @@ -75,14 +75,14 @@ $ wget http://snap.ci.snap-telemetry.io/plugins/snap-plugin-collector-psutil/lat $ wget http://snap.ci.snap-telemetry.io/plugins/snap-plugin-processor-statistics/latest/linux/x86_64/snap-plugin-processor-statistics $ wget http://snap.ci.snap-telemetry.io/plugins/snap-plugin-publisher-file/latest/linux/x86_64/snap-plugin-publisher-file $ chmod 755 snap-plugin-* -$ snapctl plugin load snap-plugin-collector-psutil -$ snapctl plugin load snap-plugin-publisher-file -$ snapctl plugin load snap-plugin-processor-statistics +$ snaptel plugin load snap-plugin-collector-psutil +$ snaptel plugin load snap-plugin-publisher-file +$ snaptel plugin load snap-plugin-processor-statistics ``` See available metrics for your system ``` -$ snapctl metric list +$ snaptel metric list ``` Create a task file. For example, sample-psutil-statistics-task.json: @@ -130,7 +130,7 @@ Creating a task manifest file. Start task: ``` -$ snapctl task create -t sample-psutil-statistics-task.json +$ snaptel task create -t sample-psutil-statistics-task.json Using task manifest to create task Task created ID: 02dd7ff4-8106-47e9-8b86-70067cd0a850 @@ -138,16 +138,16 @@ Name: Task-02dd7ff4-8106-47e9-8b86-70067cd0a850 State: Running ``` -See realtime output from `snapctl task watch ` (CTRL+C to exit) +See realtime output from `snaptel task watch ` (CTRL+C to exit) ``` -snapctl task watch 02dd7ff4-8106-47e9-8b86-70067cd0a850 +snaptel task watch 02dd7ff4-8106-47e9-8b86-70067cd0a850 ``` This data is published to a file `/tmp/published` per task specification Stop task: ``` -$ snapctl task stop 02dd7ff4-8106-47e9-8b86-70067cd0a850 +$ snaptel task stop 02dd7ff4-8106-47e9-8b86-70067cd0a850 Task stopped: ID: 02dd7ff4-8106-47e9-8b86-70067cd0a850 ``` diff --git a/scripts/spec/task_spec.rb b/scripts/spec/task_spec.rb index c43058b..2d9a190 100755 --- a/scripts/spec/task_spec.rb +++ b/scripts/spec/task_spec.rb @@ -2,29 +2,29 @@ describe docker_build(template: SnapUtils.examples/"Dockerfile.erb", log_level: :info) do describe docker_run(described_image, :env => {'SNAP_VERSION'=>ENV['SNAP_VERSION']}, :wait => 10) do - describe file("/opt/snap/bin/snapd"), :retry => 3, :retry_wait => 5 do + describe file("/usr/local/sbin/snapteld"), :retry => 3, :retry_wait => 5 do it { should be_file } it { should be_executable } end - describe file("/opt/snap/bin/snapctl") do + describe file("/usr/local/bin/snaptel") do it { should be_file } it { should be_executable } end - describe command("snapd --version") do + describe command("snapteld --version") do its(:exit_status) { should eq 0 } its(:stdout) { should contain /#{ENV['SNAP_VERSION']}/ } end if ENV['SNAP_VERSION'] =~ /^\d+.\d+.\d+$/ # NOTE: using ip instead of localhost due a known issue with alpine: # https://github.com/gliderlabs/docker-alpine/issues/8 - snapctl = "snapctl -u 'http://127.0.0.1:8181'" + snaptel = "snaptel -u 'http://127.0.0.1:8181'" - describe "snapctl plugin list", :retry => 3, :retry_wait => 10 do + describe "snaptel plugin list", :retry => 3, :retry_wait => 10 do it { - cmd=cmd_with_retry("#{snapctl} plugin list") + cmd=cmd_with_retry("#{snaptel} plugin list") expect(cmd.exit_status).to eq 0 expect(cmd.stdout).to contain /psutil/ expect(cmd.stdout).to contain /file/ @@ -36,7 +36,7 @@ context "Snap task #{t}" do task_id = nil - describe command("#{snapctl} task create -t /opt/snap/tasks/#{t}") do + describe command("#{snaptel} task create -t /opt/snap/tasks/#{t}") do its(:exit_status) { should eq 0 } its(:stdout) { should contain /Task created/ } it { @@ -46,11 +46,11 @@ } end - describe "snapctl task list" do + describe "snaptel task list" do it { # NOTE: The sleep here is to ensure the plugin isn't disabled sleep 15 - cmd=command("#{snapctl} task list") + cmd=command("#{snaptel} task list") expect(cmd.exit_status).to eq 0 expect(cmd.stdout).to contain /Running/ } @@ -76,7 +76,7 @@ # NOTE: can not use the normal describe command(...) since we need to access task_id describe "Stop task" do it { - c = command("#{snapctl} task stop #{task_id}") + c = command("#{snaptel} task stop #{task_id}") expect(c.exit_status).to eq 0 expect(c.stdout).to match /Task stopped/ } @@ -84,7 +84,7 @@ describe "Remove task" do it { - c = command("#{snapctl} task remove #{task_id}") + c = command("#{snaptel} task remove #{task_id}") expect(c.exit_status).to eq 0 expect(c.stdout).to match /Task removed/ } @@ -92,4 +92,4 @@ end end end -end \ No newline at end of file +end