This Snap plugin collects a few metrics using pslist.exe (# of processes, threads, handles). The script will also automatically download the executable from the Microsoft site.
To build this plugin through the Snap github repository:
Download the zip file from github (or clone the repo)
Set up Golang on your machine
a. Download Golang
b. Install Golang
c. Set up environmnet variables (both GO and GOPATH)
Download Glide (to be able to download packages)
a. Download Glide
b. Set an environment path for glide (or just move the exe file around)
Set up the dependencies through Glide
glide.exe install
go build scripts\build_all.sh
Download the sysinternals plugin
Install dependencies for the plugin using glide
Build the project through Go
go build github.com\Snap-for-Windows\snap-plugin-collector-sysinternals
Run snapteld.exe with the appropriate flags (example below)
snapteld.exe --plugin-trust 0 --log-level 1
Load the plugin through snaptel.exe
snaptel.exe plugin load snap-plugin-collector-sysinternals.exe
Plugin loaded
Name: sysinternals-collector
Version: 1
Type: collector
Signed: false
Loaded Time: Mon, 20 Feb 2017 11:17:17 MST
Enjoy!
The plugin collects the following:
Namespace | Description |
---|---|
/intel/sysinternals/handleCount | gets the number of handles |
/intel/sysinternals/processCount | gets the number of processes |
/intel/sysinternals/threadCount | gets the number of threads |
Load sysinternals plugin
See available metrics for your system
snaptel.exe metric list
Run the plugin using a task manifest file (the below example uses the Snap mock file plugin to output the data to a text file)
{
"version": 1,
"schedule": {
"type": "simple",
"interval": "30s"
},
"max-failures": 10,
"workflow": {
"collect": {
"metrics": {
"/intel/sysinternals/handleCount": {},
"/intel/sysinternals/processCount": {},
"/intel/sysinternals/threadCount": {}
},
"process": [
{
"plugin_name": "passthru-grpc",
"process": null,
"publish": [
{
"plugin_name": "mock-file-grpc",
"config": {
"file": "C:\\SnapLogs\\snap-sysinternals-file.log"
}
}
]
]
}
}
}
Create task:
snaptel.exe task create -t sysinternal-file.yaml
Stop task (use the task ID that was given the the task was initially created):
snaptel.exe task stop 4a156b0f-582f-4a13-8d67-120a2ba72e1d
Task stopped:
ID: 4a156b0f-582f-4a13-8d67-120a2ba72e1d
This repository is one of many plugins in Snap, a powerful telemetry framework. See the full project at http://github.com/intelsdi-x/snap To reach out to other users, head to the main framework
We love contributions!
There's more than one way to give back, from examples to blogs to code updates. See our recommended process in CONTRIBUTING.md.
Snap, along with this plugin, is an Open Source software released under the Apache 2.0 License.
And thank you! Your contribution, through code and participation, is incredibly important to us.