12. NetSpyGlass Server Command Line Tools¶
We offer a set of command line tools that are designed to interact with NetSpyGlass server and can be used to control it or run queries against it. These tools are written in Python and can be installed using Python package nsgcli using pip. See https://pypi.org/project/nsgcli/ Here are the steps you need to take.
- make sure you have Python 3.9 or newer on your system
- install and upgrade pip if it is not installed:
python3 -m ensurepip --default-pip
python3 -m pip install --upgrade pip setuptools
now you can install nsgcli:
python3 -m pip install --upgrade nsgcli
You may need to use sudo because pip will try to install command line scripts in /usr/local/bin.
The package installs Python library and command line scripts nsgcli, nsgql, nsggrok. Script nsgcli can be used to inspect the satus of the server and perform some administrative actions. Script nsgql can be used to run NsgQL queries against the server. Script nsggrok can be used to test Grok patterns used to parse syslog messages (see Grok)
See NetSpyGlass Server Query Language for more details on NsgQL.
All scripts installed by package nsgcli have built-in help which you can get using command line option “–help”
12.1. NsgCLI¶
TODO: write this section