Automatic baseline calculation for FastNetMon

Important note: Before beginning this guide, we recommend trying our new baseline recommendation logic, as it offers better integration with FastNetMon.

This tool is an experimental feature; please do not use it without rigorous testing.

You can download the current version here

Known restrictions:

  • Removes all existing non-global host groups
  • IPv4 only
  • Does not reload FastNetMon automatically

Dependencies:

The threshold calculation tool has the following configuration file at /etc/fastnetmon/baseline_magician.conf:

{
  "clickhouse_host": "127.0.0.1",
  "clickhouse_port": 9000, 
  "calculaton_period": 604800,
  "clickhouse_database": "fastnetmon",
  "clickhouse_table": "host_metrics",

  "api_user": "admin",
  "api_password": "XXX",
  "api_host": "127.0.0.1",
  "api_port": 10007,
  "generate_incoming_packet_threshold": true,
  "incoming_packet_expression": "value * 2",
  "generate_incoming_bit_threshold": true,
  "incoming_bit_expression": "value * 3",
  "generate_incoming_flow_threshold": true,
  "incoming_flow_expression": "value + 200",
  
  "remove_existing_hostgroups": true,
  "aggregation_function": "max"
}

All fields with expression suffix keep math expressions to calculate threshold/baseline value from aggregated value (using aggregation_function) of particular threshold from Clickhouse (calculated over the last 7 days).

Run it the following way:

sudo chmod +x baseline_magician
sudo ./baseline_magician

This tool can create a host group for each of your networks according to thresholds configured according to average bandwidth usage from Clickhouse.

Note: This tool removes all your existing host groups and keeps only the global host group. Proceed with care.

It does not restart FastNetMon to apply changes. You need to restart manually. In case of any issues, please report to our support team.

This tool is open source, and you can find the source code here.