We offer complete REST based API in FastNetMon Advanced.

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:

sudo fcli set main web_api_login admin
sudo fcli set main web_api_password your_password_replace_it
sudo fcli set main web_api_port 10007
sudo fcli set main web_api_host

Apply changes:

sudo systemctl restart fastnetmon_web_api

If you experience any issues, we suggest checking logs:

sudo tail -f /var/log/fastnetmon/api_gateway.log

Execute example query to get license:

curl -X GET -u admin:YOU_PASSWORD

FastNetMon API based on well known fcli tool.

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

JSON_MODE=on sudo -E fcli show bgp

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):

curl -X PUT -u apiuser:securepass9

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

curl -X DELETE -u apiuser:securepass9

To show something, you could use GET HTTP method:

curl -X GET -u apiuser:securepass9

To show whole category use:

curl -X GET -u apiuser:securepass9

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:

{"success":false,"error_text":"Category name hostgroupddd is not supported"}

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

Example for boolean value:

curl -X GET -u apiuser:securepass9

Example for string value:

curl -X GET -u apiuser:securepass9

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

curl -X GET -u apiuser:securepass9

If command returns hash map / table / dictionary FastNetMon encodes them as JSON dictionary:

curl -X GET -u apiuser:securepass9

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

curl -X GET -u apiuser:securepass9

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

curl -X GET -u apiuser:securepass9

Or flow spec announces:

curl -X GET -u apiuser:securepass9

To put blackhole host, use this:

curl -X PUT -u admin:securepass9

After making any changes, you have to trigger commit command to apply changes for FastNetMon’s engine:

curl -X PUT -u admin:securepass9

Complete example to ban and then unban host

Ban it:

curl -X PUT -u admin:securepass9

Check list of banned hosts:

curl -X GET -u admin:securepass9



And finally unban it by UUID:

curl -X DELETE -u admin:securepass9

Some some command which expect large JSON documents you may pass JSON documents as part of JSON query:

curl -vv -X PUT -u admin:securepass9  -H "Content-Type: application/json" -d '{"source_prefix":"", "destination_prefix":"", "action_type":"discard"}'

We have number of example tools implemented for our API to provide examples:

  • API client which creates and removes networks from FastNetMon
  • API client which can block and unblock IP address

24/7 Tech Support


Email Us