我是vnstat
第一次使用,使用时出现此错误vnstat -d
错误:无法读取数据库“/var/lib/vnstat/eth0”:没有那个文件或目录
里面的文件/var/lib/vnstat
是
enp1s0 wlp2s0
Run Code Online (Sandbox Code Playgroud)
这些是我的网络接口。
我可以使用eth0
file来理解它,但是如何将默认文件更改为enp1s0
from eth0
.
当我使用时sudo vnstat -u -i eth0
,我收到错误
错误:无法读取数据库“/var/lib/vnstat/eth0”:没有那个文件或目录错误:无法获取接口“eth0”统计信息。只能添加可用接口进行监控。
默认接口在/etc/vnstat.conf
文件中定义:
$ head /etc/vnstat.conf
# vnStat 1.13 config file
##
# default interface
Interface "eth0"
# location of the database directory
DatabaseDir "/var/lib/vnstat"
# locale (LC_ALL) ("-" = use system locale)
Run Code Online (Sandbox Code Playgroud)
尽管您可以在那里更改它,但可能更好的方法是创建自己的~/.vnstatrc
文件并对其进行修改:
cp /etc/vnstat.conf ~/.vnstatrc
Run Code Online (Sandbox Code Playgroud)
然后使用您选择的编辑器更改Interface "eth0"
为Interface "enp1s0"
本地副本。
请参阅man vnstat.conf
完整的详细信息。
归档时间: |
|
查看次数: |
5377 次 |
最近记录: |