Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
23.7 Legacy Series
»
Netflow - keep last X days - db limit
« previous
next »
Print
Pages: [
1
]
Author
Topic: Netflow - keep last X days - db limit (Read 843 times)
e97
Newbie
Posts: 8
Karma: 0
Netflow - keep last X days - db limit
«
on:
December 19, 2023, 01:12:19 am »
Disk is filling up with netflow logs from local collector. Only want netflow for the past X days.
I've since turned off netflow to avoid disk full.
There is an old thread (20.7) about this with no response:
https://forum.opnsense.org/index.php?topic=20262.msg93861
Is this possible in 23.7?
If not, this is my implementation idea I'd like feedback on:
Since the logs are stored in sqlite, use python3 to connect to sqlite db and delete rows older than X days.
This functionality can be added to flowd_aggregate and exposed on the Reporting > Settings page in the webUI and only apply to local collector.
..and where is the code for the local collector?
Logged
doktornotor
Hero Member
Posts: 709
Karma: 70
Re: Netflow - keep last X days - db limit
«
Reply #1 on:
December 19, 2023, 05:59:16 pm »
No, nothing to limit anything and with sqlite vacuum it's probably gonna kill your box with OOM before anything gets done.
Logged
becks0815
Newbie
Posts: 15
Karma: 1
Re: Netflow - keep last X days - db limit
«
Reply #2 on:
January 18, 2024, 09:21:42 am »
I also would love to have a solution for this. I found out that my FW consumes a lot of power, even when there is no traffic, and after searching for a while, I came across netflow, which consumes 99.7% of a single core (Intel N100), with a SQL lite db of 6.1 GB size.
Turning off netflow resulted in a drastic reduction of the CPU power consumption, re-enabling in the observed behavior. After I manually resetted netflow data, enabling netflow didn't result in the cpu usage increase like before, so I am pretty sure the python process consumes a lot of power when writing to a big db (on a SSD, ZFS formatted, in case it is interesting).
So is there a function available to drop data after X days, reduce the db size and also cpu usage?
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
23.7 Legacy Series
»
Netflow - keep last X days - db limit