When using vnstat first time or without persistent data (such as openwrt with data stored in flash), the output of the command vnstat --oneline at startup will be:
# vnstat --oneline
enp2s0: Not enough data available yet.
and the indexing operation in the code will cause panic.
And the man page of vnstat says "The output contains 15 fields with ; used as field delimiter".
--oneline [mode]
Show traffic summary for selected interface using one line with a parsable format. The output contains 15 fields with ; used as field delimiter.
When using vnstat first time or without persistent data (such as openwrt with data stored in flash), the output of the command
vnstat --oneline
at startup will be:and the indexing operation in the code will cause panic.
And the man page of vnstat says "The output contains 15 fields with ; used as field delimiter".