This plugin counts IP addresses of responding hosts. Ping algorithm is based on ipcalc.go GigHubGist from Kota Kanbe
It's used in the snap framework.
- golang 1.5+ - needed only for building. See also How to install Go language
All OSs currently supported by snap:
- Linux/amd64
$ go get -u github.com/IrekRomaniuk/snap-plugin-collector-pingscan
- Set up the snap framework.
- Load the plugin and create a task, see example in Examples.
This plugin has the ability to gather the following metric:
Namespace | Description |
---|---|
/niuk/pingscan/total-up | total number of hosts responding |
Example running pingscan collector and writing data to an Influx database.
Load pingscan plugin
$ snaptel plugin load $GOPATH/bin/snap-plugin-collector-pingscan
List available plugins
$ snaptel task watch 4df1ddea-11ef-49e9-867b-6f19658cf16e
Watching Task (4df1ddea-11ef-49e9-867b-6f19658cf16e):
NAMESPACE DATA TIMESTAMP
niuk/pingscan/total-up 1102 2016-12-08 14:58:54.176178073 -0500 EST
See available metrics for your system
$ snaptel metric list
Create a task manifest file (see below) and put full path to the file listing IP addresses:
deadline: "15s"
version: 1
schedule:
type: "simple"
interval: "30s"
max-failures: 10
workflow:
collect:
metrics:
/niuk/pingscan/total-up: {}
config:
/niuk/pingscan:
target: "/home/global/path/examples/pinglist.txt"
Load influxdb plugin for publishing:
$ snaptel plugin load snap-plugin-publisher-influxdb
Create a task:
$ snaptel task create -t pingscan.yml -n pingscan
Using task manifest to create task
Task created
ID: 4df1ddea-11ef-49e9-867b-6f19658cf16e
Name: pingscan-shields
State: Running
List running tasks:
$ snaptel task list
ID NAME STATE HIT MISS FAIL CREATED LAST FAILURE
4df1ddea-11ef-49e9-867b-6f19658cf16e pingscan-shields Running 53 0 0 2:50PM 12-08-2016
Watch the task
$ snaptel task watch 4df1ddea-11ef-49e9-867b-6f19658cf16e
Watching Task (4df1ddea-11ef-49e9-867b-6f19658cf16e):
NAMESPACE DATA TIMESTAMP
niuk/pingscan/total-up 1102 2016-12-08 14:58:54.176178073 -0500 EST
Watch metrics in real-time using [snap plugin for Grafana] (https://blog.raintank.io/using-grafana-with-intels-snap-for-ad-hoc-metric-exploration/)
This plugin is Open Source software released under the Apache 2.0 License.
- Author: @IrekRomaniuk