• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
WebSetNet

WebSetNet

Technology News

  • Technology News
    • Mobile
    • Games
  • Internet Marketing
  • System Admin
    • Windows
    • Linux
    • Mac & Apple
    • Website Scripts
      • Wordpress

Fix vnStat Not Automatically Updating

August 5, 2020 by Martin6


There was a problem for me after publishing the vnStat PHP article, it’s vnStat console could not update its database automatically. The result was vnStat PHP cannot update the data automatically as well. The cause is probably because I accidentally ran vnstat update as root. But apparently the solution is easy. Just make the user of vnstatd daemon the owner of the database directory.

See The User

Actually, when vnStat console being installed, it creates a new user named vnstat in our system. This is the user that runs our vnstatd daemon and updates the database. You can see it by command below. See the most left column, that’s the username: “vnstat”.

$ ps aux | grep vnstat

The Problem

The problem is whether the database directory is owned by vnstat user or not. When it’s not, of course vnstat console cannot update the traffic data unless we force it manually with sudo (or by root).

The Solution

Do chown to /var/lib/vnstat/ directory (where databases are stored) so it and its files re-owned by vnstat user.

$ sudo chmod -v -R vnstat:vnstat /var/lib/vnstat/

The Result

You should see that the vnstat/ directory itself, and all files inside it, are owned by same user “vnstat”. See them by command below.

$ ls alR /var/lib/vnstat/


And both the vnstat console and vnStat PHP should now update the data automatically. Check your /etc/vnstat.conf file for the time delay between one and another updates.

References


http://askubuntu.com/questions/500663/vnstat-not-updating
http://serverfault.com/questions/350455/vnstat-only-updates-on-live

 

Source

Related posts:

  1. Install Moodle eLearning Platform on Debian 9
  2. Install vnStat PHP on Ubuntu Desktop for Beginners
  3. How to Install Zen Cart on Debian 9
  4. Create an Online Social Network with Elgg on Debian 9
  5. How to Install Cacti SNMP Monitoring Tool on Debian 9
  6. How to Install Magento 2.1 on CentOS 7
  7. Install and Configure LEMP Stack in Debian 9
  8. How to install PHP 7.x as PHP-FPM & FastCGI for ISPConfig 3.1 with apt on Debian 8 and 9
  9. How to Install WordPress with HHVM and Nginx on CentOS 7
  10. How to Install LibreNMS Monitoring Tool with Nginx on CentOS 7

Filed Under: vnStat

Primary Sidebar

Trending

  • How to fix Windows Update Error 80244019
  • Windows 10 Update keeps failing with error 0x8007001f – 0x20006
  • How To Change Netflix Download Location In Windows 10
  • Troubleshoot Outlook “Not implemented” Unable to Send Email Error
  • How do I enable or disable Alt Gr key on Windows 10 keyboard
  • How To Install Android App APK on Samsung Tizen OS Device
  • 3 Ways To Open PST File Without Office Outlook In Windows 10
  • FIX: Windows Update error 0x800f0986
  • How to Retrieve Deleted Messages on Snapchat
  • Latest Samsung Galaxy Note 20 leak is a spec dump revealing key features
  • Install Android 7.0 Nougat ROM on Galaxy Core 2 SM-G355H
  • 192.168.1.1 Login, Admin Page, Username, Password | Wireless Router Settings
  • Websites to Watch Movies Online – 10+ Best Websites Without SignUp/Downloading
  • How to Backup SMS Messages on Your Android Smartphone
  • How to delete a blank page at the end of a Microsoft Word document
  • Fix: The Disc Image File Is Corrupted Error In Windows 10
  • Android 11 Custom ROM List – Unofficially Update Your Android Phone!
  • Samsung Galaxy Z Fold 3 could be scheduled for June 2021, with S Pen support

Footer

Tags

Amazon amazon prime amazon prime video Apple Application software epic games Galaxy Note 20 Galaxy S22 Plus Galaxy S22 Ultra Google Sheets headphones Huawei icloud Instagram instant gaming ip address iPhone iphone 12 iphone 13 iphone 13 pro max macOS Microsoft Microsoft Edge Mobile app office 365 outlook Pixel 6 Samsung Galaxy Samsung Galaxy Book 2 Pro 360 Samsung Galaxy Tab S8 Smartphone speedtest speed test teams tiktok Twitter vpn WhatsApp whatsapp web Windows 10 Windows 11 Changes Windows 11 Release Windows 11 Update Windows Subsystem For Android Windows 11 Xiaomi

Archives

  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org