Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #26 from lmroz/readme_10_update
Browse files Browse the repository at this point in the history
Documentation update
  • Loading branch information
katarzyna-z authored Nov 22, 2016
2 parents 248fbc6 + 63f1e9b commit 2f8d3d9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 37 deletions.
56 changes: 20 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ In order to use this plugin user is required to have PCM installed in system.
### System Requirements

* [Intel PCM] (http://www.intel.com/software/pcm)
* [golang 1.5+](https://golang.org/dl/) (needed only for building)
* Root privileges (snapd has to be running with root privileges for ability to collect data from PCM)
* [golang 1.6+](https://golang.org/dl/) (needed only for building)
* Root privileges (snapteld has to be running with root privileges for ability to collect data from PCM)

**Suggestions**
* To be able, to use PCM, [NMI watchdog](https://en.wikipedia.org/wiki/Non-maskable_interrupt) needs to be disabled. There are two ways to do this:
Expand Down Expand Up @@ -54,12 +54,9 @@ Build the plugin by running make within the cloned repo:
$ make
```

This builds the plugin in `/build/rootfs/`
This builds the plugin in `./build/`

### Configuration and Usage
* Set up the [snap framework](https://github.com/intelsdi-x/snap/blob/master/README.md#getting-started)
* Ensure `$SNAP_PATH` is exported
`export SNAP_PATH=$GOPATH/src/github.com/intelsdi-x/snap/build`

By default pcm executable binary are searched in the directories named by the PATH environment.
Customize path to pcm executable is also possible by setting environment variable `export SNAP_PCM_PATH=/path/to/pcm/bin`
Expand Down Expand Up @@ -108,37 +105,24 @@ Metrics exposed by "pcm" are system related and might be varied.
By default metrics are gathered once per second.

### Examples
Example running pcm collector and writing data to file. Notice that snapd has to be running with root privileges, for ability to collect data from PCM
Example running pcm collector and writing data to file. Notice that snapteld has to be running with root privileges, for ability to collect data from PCM

In one terminal window, open the snap daemon:
```
$ snapd -l 1 -t 0
```
Ensure [snap daemon is running](https://github.com/intelsdi-x/snap#running-snap):
* initd: `sudo service snap-telemetry start`
* systemd: `sudo systemctl start snap-telemetry`
* command line: `sudo snapteld -l 1 -t 0 &`

In another terminal window, load pcm plugin for collecting:
```
$ snapctl plugin load $SNAP_PCM_PLUGIN_DIR/build/rootfs/snap-plugin-collector-pcm
Plugin loaded
Name: pcm
Version: 8
Type: collector
Signed: false
Loaded Time: Wed, 02 Dec 2015 07:57:33 EST
Download and load snap plugins:
```
See available metrics for your system:
```
$ snapctl metric list
$ wget http://snap.ci.snap-telemetry.io/plugins/snap-plugin-collector-pcm/latest/linux/x86_64/snap-plugin-collector-pcm
$ wget http://snap.ci.snap-telemetry.io/plugins/snap-plugin-publisher-file/latest/linux/x86_64/snap-plugin-publisher-file
$ snaptel plugin load snap-plugin-collector-pcm
$ snaptel plugin load snap-plugin-publisher-file
```

Load file plugin for publishing:
See available metrics for your system:
```
$ snapctl plugin load $SNAP_DIR/build/plugin/snap-publisher-file
Plugin loaded
Name: file
Version: 3
Type: publisher
Signed: false
Loaded Time: Wed, 02 Dec 2015 07:58:47 EST
$ snaptel metric list
```

Create a task JSON file (exemplary file in examples/tasks/pcm-file.json):
Expand Down Expand Up @@ -193,18 +177,18 @@ Create a task JSON file (exemplary file in examples/tasks/pcm-file.json):

Create a task:
```
snapctl task create -t $SNAP_PCM_PLUGIN_DIR/examples/tasks/pcm-file.json
snaptel task create -t examples/tasks/pcm-file.json
Using task manifest to create task
Task created
ID: 156366f2-e497-4c10-ad22-560fc71986af
Name: Task-156366f2-e497-4c10-ad22-560fc71986af
State: Running
```

See sample output from `snapctl task watch <task_id>`
See sample output from `snaptel task watch <task_id>`

```
$ snapctl task watch 156366f2-e497-4c10-ad22-560fc71986af
$ snaptel task watch 156366f2-e497-4c10-ad22-560fc71986af
Watching Task (156366f2-e497-4c10-ad22-560fc71986af):
NAMESPACE DATA TIMESTAMP SOURCE
Expand Down Expand Up @@ -233,7 +217,7 @@ These data are published to file and stored there (in this example in /tmp/publi

Stop task:
```
$ $SNAP_PATH/bin/snapctl task stop 156366f2-e497-4c10-ad22-560fc71986af
$ snaptel task stop 156366f2-e497-4c10-ad22-560fc71986af
Task stopped:
ID: 156366f2-e497-4c10-ad22-560fc71986af
```
Expand Down Expand Up @@ -264,4 +248,4 @@ There is more than one way to give back, from examples to blogs to code updates.

* Author: [Izabella Raulin](https://github.com/IzabellaRaulin)

And **thank you!** Your contribution, through code and participation, is incredibly important to us.
And **thank you!** Your contribution, through code and participation, is incredibly important to us.
2 changes: 1 addition & 1 deletion examples/tasks/pcm-file.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"process": null,
"publish": [
{
"plugin_name": "mock-file",
"plugin_name": "file",
"config": {
"file": "/tmp/published_pcm"
}
Expand Down

0 comments on commit 2f8d3d9

Please sign in to comment.