Skip to content

happygears/netspyglass-grafana

Repository files navigation

NetSpyGlass data source plugin for Grafana

This data source enabled Grafana to query metrics collected and stored by NetSpyGlass server.

NetSpyGlass is integrated network mapping and monitoring system that presents live monitoring data as series of animated network maps. NetSpyGlass discovers your network using SNMP, builds a model that represents Layer2 connections and automatically configures itself to monitor all aspects of network devices and servers, striving to be useful “out of the box” with very little initial configuration and ongoing maintenance.

Administrator can write Python scripts that run inside of the server on every polling interval. These scripts operate with monitoring data and can be used to calculate new metrics derived from the collected "raw" data, for example various aggregates. Results produced by these scripts become part of the general data pool and are available for graphing with Grafana, as well as for alerts and reports.

NetSpyGlass requires little effort to set up and keep up with your network as it grows and can scale to thousands of devices and millions of metrics.

Features

  • Data Source plugin provides a flexible query editor with device, component and tags match
  • Data queries use SQL-like syntax (called NsgQL )
  • The user can build queries using by choosing variables, matching operators and attributes, and other parameters using drop-down lists, or by typing NsgQL query manually
  • Data Source supports Graph, Table, and Singlestat panels
  • Dashboard template variables and ad-hoc filters are supported
  • With this plugin, Grafana makes queries directly to NetSpyGlass server to receive lists of available metrics, devices, components and tags. This means it is agnostic with respect to the time series database used by the NetSpyGlass server and can work with any of them (rrd, graphite, InfluxDb, hbase)

Installation

  1. clone this git repository
  2. run script ./tools/maketar.sh. This script produces archive netspyglass-datasource-v2.tar
  3. Copy this archive to the server where Grafana runs and unpack it in the directory /var/lib/grafana/plugins/, then restart the server with command sudo service grafana-server restart.
  4. After the restart, NetSpyGlass should appear in the list of available data sources. If your NetSpyGlass server requires user authentication, add enable and configure access token. The token is set in NetSpyGlass configuration file nw2.conf using parameter key api.accessTokens.grafana
  5. Click "Add" and then "Save and Test" to test communication with the server

Screenshots

Data Source configuration:

datasource configuration

query editor screenshot

query editor screenshot

device dshboard

graph panel

table panel

Minimal supported version of Grafana is 4.4.0

(C) 2019 Happy Gears, Inc www.happygears.net

Grafana plugin for NetSpyGlass is licensed under the Apache 2.0 License

Change Log

v2.0.x

improvements to the query builder dialog, support for new NsgQL functions

v2.0.0

Tested with Grafana 4.4.0 - this is the minimal required version

  1. In this version of the plugin, we have completely changed the approach to getting data from the server, so this version is not compatible with the older ones. The server API was changed to a SQL-like syntax ( NsgQL ). The query builder is implemented from scratch in a more modern form.

Tested with Grafana 4.0.1

v1.0.4

  1. fixed regression caused by the switch to lodash 4.x. This bug broke time intervals "today", "yesterday" and others like that.

v 1.0.3

  1. Fixed regression caused by "Grafana" bug #6912 that break ability to build queries/fields.

v 1.0.2

  1. fixed bug that prevented the data source from properly fetching graph data for graphs with fixed time intervals or time intervals in the past, such as "yesterday" or "day before yesterday"
  2. made it possible to use dashboard template variables in "ALIAS BY" query field.

Development

  1. download and install nodejs from link. This package also includes npm.
  2. Clone this git repository git clone [email protected]:happygears/netspyglass-grafana.git
  3. Go to the cloned folder cd netspyglass-grafana
  4. Run npm install
  5. Use one of the following commands:
  • grunt watch # execute this command during development. It will rebuild project on every file change detection.
  • npm run build # make a development build
  • npm run build-prod # make a production build with tests and patch version
  • npm run build-prod:minor # make a production build with tests and bump minor version
  • npm run build-prod:major # make a production build with tests and bump major version