Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.
Witam!
Ostatnio zainstalowałem vnstat. I pojawił się problem mianowicie: żeby zobaczyć aktualne wyniki musze wpisywać vnstat -u.
[b]vnstat.conf[/b]
# vnStat 1.11 config file ## # default interface Interface "ppp0" # 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 0 # 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 0 # 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 # 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 1 # how often (in minutes) data is saved when all interface are offline OfflineSaveInterval 1 # 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 "/run/vnstat/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 "-"
Offline
Po zainstalowaniu on tam wypisuje, że trzeba wpisać jakieś polecenie aby zaczął zbierać informacje. Zrobiłeś to?
Offline
Chyba nie. A jakie trzeba wpisać polecenie? Daemon vnstata i tak mam włączony.
Offline
[b]jako root[/b]: vnstat -u -i interfejs
Offline
Mały offtop:
żeby vnstat działał to musze vnstat -u -i [interfejs] przy każdym uruchomieniu wpisywać.
Offline
Ja miałem identyczny problem, ale rozwiązałem go następująco:
chown -R vnstat:vnstat /var/lib/vnstat
Potem dodałem dziada do crona:
cat /etc/cron.d/vnstat SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=/dev/null HOME=/var/lib/vnstat */5 * * * * vnstat /usr/bin/vnstat -u
I chodzi bez problemu, demon vnstatd jakoś sobie nie radził, wiecznie mu nie pasowało, jak mu dodałem 3 interfejsy sieciowe..
Ostatnio edytowany przez Jacekalex (2014-05-02 19:27:41)
Offline
[quote=TDK8GB]Mały offtop:
żeby vnstat działał to musze vnstat -u -i [interfejs] przy każdym uruchomieniu wpisywać.[/quote]
Nie tylko 1x . Tylko po instalacji/od momentu kiedy chcesz zacząć zbierać dane.
Offline
Time (s) | Query |
---|---|
0.00016 | SET CHARSET latin2 |
0.00006 | SET NAMES latin2 |
0.00183 | SELECT u.*, g.*, o.logged FROM punbb_users AS u INNER JOIN punbb_groups AS g ON u.group_id=g.g_id LEFT JOIN punbb_online AS o ON o.ident='18.119.125.240' WHERE u.id=1 |
0.00091 | REPLACE INTO punbb_online (user_id, ident, logged) VALUES(1, '18.119.125.240', 1732559267) |
0.00074 | SELECT * FROM punbb_online WHERE logged<1732558967 |
0.00090 | DELETE FROM punbb_online WHERE ident='18.221.183.34' |
0.00080 | DELETE FROM punbb_online WHERE ident='18.227.48.237' |
0.00076 | DELETE FROM punbb_online WHERE ident='3.133.107.11' |
0.00083 | DELETE FROM punbb_online WHERE ident='3.133.151.90' |
0.00088 | DELETE FROM punbb_online WHERE ident='3.142.124.119' |
0.00072 | DELETE FROM punbb_online WHERE ident='3.145.72.44' |
0.00073 | DELETE FROM punbb_online WHERE ident='3.149.23.123' |
0.00065 | DELETE FROM punbb_online WHERE ident='3.15.141.155' |
0.00067 | SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM punbb_topics AS t INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=25608 AND t.moved_to IS NULL |
0.00005 | SELECT search_for, replace_with FROM punbb_censoring |
0.00222 | SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM punbb_posts AS p INNER JOIN punbb_users AS u ON u.id=p.poster_id INNER JOIN punbb_groups AS g ON g.g_id=u.group_id LEFT JOIN punbb_online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=25608 ORDER BY p.id LIMIT 0,25 |
0.00088 | UPDATE punbb_topics SET num_views=num_views+1 WHERE id=25608 |
Total query time: 0.01379 s |