vnstat
Error: Unable to read database "/var/lib/vnstat/wan".
vnstat: summary of wan
Error: Unable to read database "/var/lib/vnstat/dsl".
vnstat: summary of dsl
Starte vnstat:
Starting vnstat...Zero database found, exiting.
failed.
/var/mod/root # vnstat -u -i dsl
Error: Not enough free diskspace available.
/var/mod/root # ls -l /var/lib/vnstat
lrwxrwxrwx 1 root root 12 Jan 7 22:01 /var/lib/vnstat -> /tmp/vnstatd
/var/mod/root # sh -x /etc/init.d/rc.vnstat start
+ . /etc/init.d/modlibrc
+ export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/mod/sbin:/mod/bin:/mod/usr/sbin:/mod/usr/bin
+ export LD_LIBRARY_PATH=/mod/lib:/mod/usr/lib
+ [ -n ]
+ HTTPD_PID_VNS=/var/run/httpd_vns.pid
+ [ ! -r /mod/etc/conf/vnstat.cfg ]
+ . /mod/etc/conf/vnstat.cfg
+ export VNSTAT_ENABLED=no
+ export VNSTAT_DBDIR=/tmp/vnstatd
+ export VNSTAT_INTERFACES=wan dsl
+ export VNSTAT_WEBENABLED=no
+ export VNSTAT_WEB_PORT=87
+ export VNSTAT_WEB_AUTH=no
+ export VNSTAT_WEB_USER=vnstat
+ export VNSTAT_WEB_PASS=freetz
+ config
+ mkdir /tmp/vnstatd
+ mkdir -p /var/lib
+ rm -rf /var/lib/vnstat
+ ln -s /tmp/vnstatd /var/lib/vnstat
+ start
+ echo -n Starting vnstat...
Starting vnstat...+ pidof vnstatd
+ [ ! -z ]
+ [ -z wan dsl ]
+ ls -A /var/lib/vnstat/
+ vnstat -u -i wan
+ vnstat -u -i dsl
+ cat /var/run/httpd_vns.pid
+ kill -9
+ [ no = yes ]
+ vnstatd -s -d
Zero database found, exiting.
+ exitval=1
+ [ 1 -eq 0 ]
+ echo failed.
failed.
+ exit 1
lrwxrwxrwx 1 root root 29 Jan 7 22:18 vnstat -> /var/media/ftp/uStor01/vnstat
lrwxrwxrwx 1 root root 30 Jan 7 22:18 vnstatd -> /var/media/ftp/uStor01/vnstatd
/var/tmp # vnstat -u -i dsl
Error: Unable to read database "/var/lib/vnstat/dsl".
Info: -> A new database has been created.
/var/tmp # cd /var/media/ftp/uStor01/vnstat
/var/media/ftp/uStor01/vnstat # ls -l
-rw-r--r-- 1 root root 2031 Jan 7 22:23 dsl-summary.png
-rw-r--r-- 1 root root 1790 Jan 7 22:23 wan-summary.png
/var/media/ftp/uStor01/vnstat # cd ..
/var/media/ftp/uStor01 # cd vnstatd
/var/media/ftp/uStor01/vnstatd # ls -l
-rw-r--r-- 1 root root 2784 Jan 7 22:25 dsl
-rw-r--r-- 1 root root 2784 Jan 7 22:25 wan
/var/tmp # sh -x /etc/init.d/rc.vnstat start
+ . /etc/init.d/modlibrc
+ export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/mod/sbin:/mod/bin:/mod/usr/sbin:/mod/usr/bin
+ export LD_LIBRARY_PATH=/mod/lib:/mod/usr/lib
+ [ -n ]
+ HTTPD_PID_VNS=/var/run/httpd_vns.pid
+ [ ! -r /mod/etc/conf/vnstat.cfg ]
+ . /mod/etc/conf/vnstat.cfg
+ export VNSTAT_ENABLED=no
+ export VNSTAT_DBDIR=/tmp/vnstatd
+ export VNSTAT_INTERFACES=wan dsl
+ export VNSTAT_WEBENABLED=no
+ export VNSTAT_WEB_PORT=87
+ export VNSTAT_WEB_AUTH=no
+ export VNSTAT_WEB_USER=vnstat
+ export VNSTAT_WEB_PASS=freetz
+ config
+ mkdir /tmp/vnstatd
+ mkdir -p /var/lib
+ rm -rf /var/lib/vnstat
+ ln -s /tmp/vnstatd /var/lib/vnstat
+ start
+ echo -n Starting vnstat...
Starting vnstat...+ pidof vnstatd
+ [ ! -z ]
+ [ -z wan dsl ]
+ ls -A /var/lib/vnstat/
+ useif=no
+ [ wan = dsl -o .wan = dsl ]
+ [ dsl = dsl -o .dsl = dsl ]
+ useif=yes
+ [ yes = no ]
+ vnstat -u -i wan
+ vnstat -u -i dsl
+ cat /var/run/httpd_vns.pid
+ kill -9
+ [ no = yes ]
+ vnstatd -s -d
+ exitval=0
+ [ 0 -eq 0 ]
+ echo done.
done.
/var/mod/root # cd /var/lib
/var/lib # ls -l
lrwxrwxrwx 1 root root 30 Jan 7 23:23 vnstat -> /var/media/ftp/uStor01/vnstatd
Aber weshalb möchtest du unter /var/ die Dateien erstellen? Die werden beim Reboot gelöscht
Im Trunk ab #4190 jetzt mit konfigurierbarer vnstat.conf
Thanks.Uups, vergessen. Hab auch einen Hinweis in die .conf gemacht.
CheckDiskSpac=0 als default finde ich nicht so gut. Was meinen denn andere dazu?
/var/media/ftp/uStor01 # cat /var/mod/etc/conf/vnstat.cfg
export VNSTAT_DBDIR='/var/media/ftp/uStor01/vnstatd'
export VNSTAT_ENABLED='yes'
export VNSTAT_INTERFACES='dsl lan wifi0'
export VNSTAT_WEBENABLED='no'
export VNSTAT_WEB_AUTH='no'
export VNSTAT_WEB_PASS='freetz'
export VNSTAT_WEB_PORT='87'
export VNSTAT_WEB_USER='vnstat'
/var/media/ftp/uStor01 #
/var/media/ftp/uStor01 # cat /var/tmp/flash/vnstat/vnstat.conf
# vnStat 1.10 config file
##
# default interface
Interface "wifi0"
### The DatabaseDir should NOT be changed here, use the Freetz-Webinterface!
# location of the database directory
DatabaseDir "/var/lib/vnstat"
# locale (LC_ALL) ("-" = use system locale)
Locale "-"
# on which day should months change
MonthRotate 1
# date output formats for -d, -m, -t and -w
# see 'man date' for control codes
DayFormat "%x"
MonthFormat "%b '%y"
TopFormat "%x"
# characters used for visuals
RXCharacter "%"
TXCharacter ":"
RXHourCharacter "r"
TXHourCharacter "t"
# how units are prefixed when traffic is shown
# 0 = IEC standard prefixes (KiB/MiB/GiB/TiB)
# 1 = old style binary prefixes (KB/MB/GB/TB)
UnitMode 1
# output style
# 0 = minimal & narrow, 1 = bar column visible
# 2 = same as 1 except rate in summary and weekly
# 3 = rate column visible
OutputStyle 3
# used rate unit (0 = bytes, 1 = bits)
RateUnit 1
# maximum bandwidth (Mbit) for all interfaces, 0 = disable feature
# (unless interface specific limit is given)
MaxBandwidth 100
# interface specific limits
# example 8Mbit limit for eth0 (remove # to activate):
#MaxBWeth0 8
# how many seconds should sampling for -tr take by default
Sampletime 5
# default query mode
# 0 = normal, 1 = days, 2 = months, 3 = top10
# 4 = dumpdb, 5 = short, 6 = weeks, 7 = hours
QueryMode 0
### You have to set CheckDiskSpace to 0 if you would like to save your databases to /tmp/!
# filesystem disk space check (1 = enabled, 0 = disabled)
CheckDiskSpace 1
# database file locking (1 = enabled, 0 = disabled)
UseFileLocking 1
# how much the boot time can variate between updates (seconds)
BootVariation 15
# log days without traffic to daily list (1 = enabled, 0 = disabled)
TrafficlessDays 1
# vnstatd
##
# how often (in seconds) interface data is updated
UpdateInterval 30
# how often (in seconds) interface status changes are checked
PollInterval 5
# how often (in minutes) data is saved to file
SaveInterval 5
# how often (in minutes) data is saved when all interface are offline
OfflineSaveInterval 30
# force data save when interface status changes (1 = enabled, 0 = disabled)
SaveOnStatusChange 1
# enable / disable logging (0 = disabled, 1 = logfile, 2 = syslog)
UseLogging 2
# file used for logging if UseLogging is set to 1
LogFile "/var/log/vnstat.log"
# file used as daemon pid / lock file
PidFile "/var/run/vnstat.pid"
# vnstati
##
# title timestamp format
HeaderFormat "%x %H:%M"
# show hours with rate (1 = enabled, 0 = disabled)
HourlyRate 1
# show rate in summary (1 = enabled, 0 = disabled)
SummaryRate 1
# layout of summary (1 = with monthly, 0 = without monthly)
SummaryLayout 1
# transparent background (1 = enabled, 0 = disabled)
TransparentBg 0
# image colors
CBackground "FFFFFF"
CEdge "AEAEAE"
CHeader "606060"
CHeaderTitle "FFFFFF"
CHeaderDate "FFFFFF"
CText "000000"
CLine "B0B0B0"
CLineL "-"
CRx "92CF00"
CTx "606060"
CRxD "-"
CTxD "-"
/var/media/ftp/uStor01 #
/var/media/ftp/uStor01 # vnstat
rx / tx / total / estimated
lan:
Jan '10 213 KiB / 462 KiB / 675 KiB / 0 KiB
today 213 KiB / 462 KiB / 675 KiB / --
dsl:
Jan '10 151 KiB / 38 KiB / 189 KiB / 0 KiB
today 151 KiB / 38 KiB / 189 KiB / --
wifi0:
Jan '10 414 KiB / 412 KiB / 826 KiB / 0 KiB
today 414 KiB / 412 KiB / 826 KiB / --
/var/media/ftp/uStor01 #
/var/mod/home # ls -al /var/tmp/vnstat/
drwxr-xr-x 2 root root 0 Jan 23 08:17 .
drwxrwx-wt 7 root root 0 Jan 24 09:51 ..
/var/mod/home #
/var # ls -al
...
...
-rwxrwxrwx 1 root root 2201 Jan 21 15:40 post_install
drwxrwx--- 2 root root 0 Jan 1 2000 rpc
drwxrwx--x 4 root root 0 Jan 24 09:19 run
drwxrwxrwx 5 root root 0 Jan 1 2000 samba
drwxr-xr-x 3 root root 0 Jan 1 2000 spool
lrwxrwxrwx 1 root root 6 Jan 1 2000 sysfs -> ../sys
drwxrwx--- 2 root root 0 Jan 1 2000 tam
[B]drwxrwx-wt 7 root root 0 Jan 24 09:51 tmp[/B]
-rw-r--r-- 1 root root 822 Jan 1 2000 tr064_ssl_cert.pem
-rw-r--r-- 1 root root 0 Jan 1 2000 usbhostup
-rw-r--r-- 1 root root 973 Jan 24 08:43 wan.tc
-rw-r--r-- 1 root root 810 Jan 24 09:51 websrv_ssl_cert.pem
/var #
Die von dir angesprochene Zeile bezieht sich ja auch auf den Ordner /var/tmp
l /tmp/vnstat/
drwxr-xr-x 2 root root 0 Jan 24 12:24 .
drwxrwxrwt 9 root root 0 Jan 24 19:38 ..
-rw-r--r-- 1 root root 9426 Jan 24 12:24 wan-days.png
-rw-r--r-- 1 root root 1429 Jan 24 12:24 wan-hours.png
-rw-r--r-- 1 root root 1913 Jan 24 12:24 wan-months.png
-rw-r--r-- 1 root root 3442 Jan 24 12:24 wan-summary.png
-rw-r--r-- 1 root root 3791 Jan 24 12:24 wan-top10.png