07.12.2017

FastNetMon Advanced API

We ship API capability in FastNetMon Advanced mainline distribution but you need to execute few additional steps to enable API.

As the first step, please upgrade FastNetMon to the latest version (we offer API since 2.0.58):

And then you should apply configuration changes:

API is disabled by default because it has blank password by default. You need to generate new password to enable it.

Generate secure password and specify it as API password:

Apply changes:

If you experience any issues, we suggest to check logs:

Execute example query to get license:

FastNetMon API based on well known fcli tool.

For debugging purposes, you could switch fcli to JSON mode this way:

It will provide same messages as API provides.

Instead of “set” command, you will need to use PUT HTTP method, for example (be careful, we use URL Encode for network name because it consists slash symbol):

Instead of “delete” command you will need to use DELETE HTTP method, for example:

To show something, you could use GET HTTP method:

To show whole category use:

As you can see, in almost all cases you could replace space symbol by slash and use fcli’s format of command to talk with API.

If method failed for some reasons we return following document:

If we command returns single value we return it in “value” field.

Example for boolean value:

Example for string value:

If command returns multiple elements, we return it in “values” field:

If command returns document (hash map, dictionary) we return it in “object” field:

But we have some pretty complicated examples, for example for blackhole announces:

Or flow spec announces:

To put blackhole host, use this:

Complete example to ban and then unban host

Ban it:

Check list of banned hosts:

Output:

And finally unban it by UUID: