Highlighted
Ubiquiti Employee
Posts: 4,165
Registered: ‎12-10-2015
Kudos: 1472
Solutions: 315

Wrong NetFlow data usage 2x higher - how to fix this

Hi all,

thanks to your feedback and reports, we were able to detect a flaw in the NetFlow configuration which was set by UCRM NetFlow auto-config feature (in System > Settings > NetFlow). The data usage is 2x higher than it should be.

 

Details

  • This issue only affects WISPs who are using EdgeRouter gateways and who used UCRM auto-configuration of NetFlow rules (in System > Settings)
  • The NetFlow configuration rules set by UCRM were applied to all the EdgeRouter interfaces (but only the WAN interface should be used or all the LAN interfaces, but not all of them.) Note that UCRM can't detect which interfaces should be used (only UNMS can). That's why this auto-config feature will be removed in UCRM v.2.15
  • This issue doesn't affect you if you configured the NetFlow manually. However, you may check whether the config is set properly.

 

How to fix this

  1. Delete the EdgeRouter's NetFlow configuration which was previously set by UCRM (remove it manually on the router or using UCRM up to v2.14)
  2. Set up the correct NetFlow rules according to this guide. The data usage detected from this moment will be correct in UCRM (or any other NetFlow data consumer). 

 

Manual correction of measured client's data usage

Although, the NetFlow data are not used for automatic usage-based billing yet (it will be implemented later), you might want to fix the previously measured data in UCRM, i.e. lower the client's everyday data usage, follow these steps.

  • Fix the NetFlow configuration on your ER, use this guide. (Hint: do this after midnight or soon in the morning). Then, you should see the data measured by UCRM are correct for the whole day.
  • Create UCRM backup file (in System > Tools > Backup)
  • Execute this CLI command on your UCRM server: (you need to replace YYYY-MM-DD placeholder with the actual date when you fixed the NetFlow config, only the data before this date will be lowered 2x. For example, if you fixed the NetFlow config on 1st Feb use 2019-02-01 (all the data up to 31th Jan will be modified): 
    sudo docker exec -t ucrm_web_app_1 bash -c 'export PGPASSWORD="${POSTGRES_PASSWORD}" && psql -d "${POSTGRES_DB}" -h "${POSTGRES_HOST}" -p "${POSTGRES_PORT}" -U "${POSTGRES_USER}" -t -c "update service_accounting set upload = upload / 2, download = download / 2 where date < '"'"'YYYY-MM-DD'"'"';"'

 

We are sorry these inconveniences,

Feel free to post any further questions.