Line 6: |
Line 6: |
| [Original post http://forums.contribs.org/index.php?topic=42444]<br> | | [Original post http://forums.contribs.org/index.php?topic=42444]<br> |
| | | |
− | ===Installation=== | + | ===Installation for Koozali SME v10 === |
| + | |
| + | You need the EPEL repo |
| + | yum install smeserver-extrarepositories-epel |
| + | |
| + | Now install vnstat: |
| + | yum --enablerepo=epel install vnstat |
| + | |
| + | Next a configuration entry and unit file |
| + | config set vnstat service status enabled access private |
| + | mkdir -p /usr/lib/systemd/system/vnstat.service.d |
| + | nano /usr/lib/systemd/system/vnstat.service.d/50koozali.conf |
| + | |
| + | Paste this and save/exit: |
| + | |
| + | [Unit] |
| + | Description=Vnstat global service for Koozali SME Server |
| + | |
| + | [Install] |
| + | WantedBy= |
| + | WantedBy=sme-server.target |
| + | |
| + | Add service key: |
| + | |
| + | config set vnstat service status enabled access private |
| + | |
| + | And Upgrade/Reboot for good measure: |
| + | signal-event post-upgrade |
| + | signal-event reboot |
| + | |
| + | Are we running: |
| + | |
| + | systemctl status vnstat |
| + | |
| + | Lets look at the data: |
| + | |
| + | rx / tx / total / estimated |
| + | eth0: |
| + | Mar '24 4.36 MiB / 22.12 MiB / 26.48 MiB / 40.00 MiB |
| + | today 4.36 MiB / 22.12 MiB / 26.48 MiB / 37 MiB |
| + | |
| + | vnstat --iflist |
| + | vnstat -i eth0 |
| + | |
| + | By hour/week/month |
| + | |
| + | vnstat -h/w/m -i eth0 |
| + | |
| + | eg |
| + | |
| + | vnstat -w -i eth0 |
| + | |
| + | Remove unwanted DBs and stop monitoring the interface |
| + | vnstat -i dummy0 --delete --force |
| + | |
| + | This could be templated: |
| + | cat /etc/vnstat.conf |
| + | |
| + | |
| + | ===Installation for Koozali SME v9 === |
| To install vnStat you will need to have the Dag repository configured on your system. If you do not have the repository installed follow this instruction, otherwise skip to the next section: | | To install vnStat you will need to have the Dag repository configured on your system. If you do not have the repository installed follow this instruction, otherwise skip to the next section: |
| | | |
| ====Configuring Dag repository==== | | ====Configuring Dag repository==== |
− | {{Repository|Dag}}
| + | You need to activate the [[Dag]] reposity before installing this contrib.<br /> |
| + | |
| + | see [[dag|dag repository]] <br /> |
| | | |
| ====Install vnStat==== | | ====Install vnStat==== |
Line 24: |
Line 85: |
| | | |
| You should get an error about the database not existing but it will also say it created it. It is safe to ignore the error message. | | You should get an error about the database not existing but it will also say it created it. It is safe to ignore the error message. |
| + | |
| + | you also need to edit /etc/sysconfig/vnstat to add your iface to the update job |
| + | |
| + | vim /etc/sysconfig/vnstat |
| + | |
| + | VNSTAT_OPTIONS="-u" |
| + | see http://forums.contribs.org/index.php/topic,45174.0.html |
| | | |
| ===Install vnStat PHP FrontEnd=== | | ===Install vnStat PHP FrontEnd=== |
Line 62: |
Line 130: |
| Restart crond. | | Restart crond. |
| service crond restart | | service crond restart |
| + | |
| + | ===References=== |
| + | |
| + | http://forums.contribs.org/index.php/topic,45174.0.html |
| + | |
| + | http://forums.contribs.org/index.php/topic,48420.0.html |
| + | |
| + | http://forums.contribs.org/index.php/topic,48422.0.html |
| + | |
| + | http://humdi.net/vnstat/ |
| | | |
| ---- | | ---- |
| [[Category: Howto]] | | [[Category: Howto]] |
| [[Category: Administration:Monitoring]] | | [[Category: Administration:Monitoring]] |