vergoh / vnstat-docker Goto Github PK
View Code? Open in Web Editor NEWvnStat in a container with image output via http
Home Page: https://humdi.net/vnstat/
License: MIT License
vnStat in a container with image output via http
Home Page: https://humdi.net/vnstat/
License: MIT License
Sorry if this is not the correct place to post.
And thanks for this great tool.
I wonder if it would be possible to have the http-server serve a /metrics
-endpoint.
This way metrics could be scraped by prometheus.
Currently, timezone and localtime files must be mounted to set the correct time zone.
Adding the tzdata
package to the Alpine Linux base image will let the time zone be set through the env var TZ
.
I would like to change the unit from GiB to GB. Please tell me how.
I have many docker containers and they have their respective bridge network. These appear as "br-xxxxxxx" in ifconfig o/p.
The network ID get changed when a container is restarted. (i.e. "br-xxxxxxx" becomes "br-yyyyyyy").
Even if I set the same alias to "br-yyyyyyy" the usage associated with the "br-xxxxxxx" is no longer available in vnStat.
Any workaround to keep track of the usage of a container across restarts??
Thank you...
Using the :latest
tag on Debian 10:
[goose@Vergil: /docker/config/vnstatdb ] $ docker inspect -f '{{ json .Mounts }}' vnstat | jq
[
{
"Type": "bind",
"Source": "/etc/localtime",
"Destination": "/etc/localtime",
"Mode": "ro",
"RW": false,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/docker/config/vnstatdb",
"Destination": "/var/lib/vnstat",
"Mode": "rw",
"RW": true,
"Propagation": "rslave"
},
{
"Type": "bind",
"Source": "/etc/timezone",
"Destination": "/etc/timezone",
"Mode": "ro",
"RW": false,
"Propagation": "rprivate"
}
]
[goose@Vergil: /docker/config/vnstatdb ] $ docker exec -it vnstat cat /etc/timezone /etc/localtime
America/New_York
TZif2▒▒▒▒p▒▒▒`▒▒p▒▒▒`▒e▒p▒▒▒▒j▒p▒5▒`▒S▒▒▒`▒3▒▒▒▒▒▒▒އ▒▒p▒i▒▒R▒K௳4▒~-Qp▒gJ`▒|3p▒G,`▒\p▒'`▒;▒p▒▒`▒p▒▒▒`▒▒▒ƴ`▒▒▒▒▒▒Ĺ▒▒▒▒▒▒o▒▒�}@p▒▒9`ˈ▒p▒#▒p▒`▒▒▒u▒▒▒@▒▒▒U▒▒▒ ▒▒▒5▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒p▒▒e▒▒މpݩ▒`kp߉d`▒▒Mp▒iF`▒~/p▒I(`▒^p▒W.▒▒G-▒▒7▒▒'▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ֶ▒▒Ƶ▒▒▒`▒▒p▒`▒p▒▒`▒o▒p▒_y`▒Oxp▒?[`▒/Zp▒(w▒▒<pY▒▒▒X▒▒▒;▒▒▒:▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒w▒▒p▒``▒pP▒`@▒p0▒`▒p ▒` ▒▒▒
▒▒`
▒▒p
▒gp▒▒▒▒▒▒▒f▒▒e▒yH▒iG▒Y*▒I)▒9
▒)
▒")▒▒
`▒
p▒`▒▒p▒▒`▒▒p▒▒` v▒!▒▒`"U▒▒#j▒▒$5▒▒%J▒▒&▒▒'*s▒'▒▒p)
xpeG/`e▒Zpg'`g▒<pi▒`i▒pj▒▒`k▒:▒l▒▒▒mv▒n▒▒▒oU▒▒p▒▒▒q5▒▒ro▒▒s▒▒tOy▒t▒▒pv8▒`v▒▒pxx`x▒▒py▒Z`z▒▒p{▒<`|~gp}▒`~^Ip▒`▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒LMTEDTESTEWTEPTTZif2▒▒▒▒▒^▒▒▒▒▒▒▒p▒▒▒▒▒▒▒`▒▒▒▒▒▒p▒▒▒▒▒▒▒`▒▒▒▒▒e▒p▒▒▒▒▒▒▒▒▒▒▒▒▒j▒p▒▒▒▒▒5▒`▒▒▒▒▒S▒▒▒▒▒▒▒▒`▒▒▒▒▒3▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒އ▒▒▒▒▒▒▒p▒▒▒▒▒▒▒i▒▒▒▒▒▒▒R▒▒▒▒▒▒▒K▒▒▒▒▒▒▒4▒▒▒▒▒▒~-▒▒▒▒▒▒▒Qp▒▒▒▒▒gJ`▒▒▒▒▒|3p▒▒▒▒▒G,`▒▒▒▒▒\p▒▒▒▒▒'`▒▒▒▒▒;▒p▒▒▒▒▒▒`▒▒▒▒▒p▒▒▒▒▒▒▒`▒▒▒▒▒▒▒▒▒▒▒▒ƴ`▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒Ĺ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒o▒▒▒▒▒▒�}▒▒▒▒▒▒Ov▒▒▒▒▒▒d_▒▒▒▒▒▒/X▒▒▒▒▒▒M|p▒▒▒▒▒:▒▒▒▒▒▒-^p▒@p▒▒▒▒▒▒9`▒▒▒▒ˈ▒p▒▒▒▒▒#▒p▒▒▒▒▒`▒▒▒▒▒▒▒u▒▒▒▒▒▒▒@▒▒▒▒▒▒▒U▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒5▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒p▒▒▒▒▒▒e▒▒▒▒▒▒މp▒▒▒▒ݩ▒`▒▒▒▒kp▒▒▒▒߉d`▒▒▒▒▒▒Mp▒▒▒▒▒iF`▒▒▒▒▒~/p▒▒▒▒▒I(`▒▒▒▒▒^p▒▒▒▒▒W.▒▒▒▒▒▒G-▒▒▒▒▒▒7▒▒▒▒▒▒'▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ֶ▒▒▒▒▒▒Ƶ▒▒▒▒▒▒▒`▒▒▒▒▒▒p▒▒▒▒▒`▒▒▒▒▒p▒▒▒▒▒▒`▒▒▒▒▒o▒p▒▒▒▒▒_y`▒▒▒▒▒Oxp▒▒▒▒▒?[`▒▒▒▒▒/Zp▒▒▒▒▒(w▒▒▒▒▒▒<p▒▒▒▒Y▒▒▒▒▒▒▒X▒▒▒▒▒▒▒;▒▒▒▒▒▒▒:▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒w▒▒p▒``▒pP▒`@▒p0▒`▒p ▒` ▒▒▒
▒▒`
▒▒p
▒gp▒▒▒▒▒▒▒f▒▒e▒yH▒iG▒Y*▒I)▒9
▒)
▒")▒▒
`▒
p▒`▒▒p▒▒`▒▒p▒▒` v▒!▒▒`"U▒▒#j▒▒$5▒▒%J▒▒&▒▒'*s▒'▒▒p)
xpeG/`e▒Zpg'`g▒<pi▒`i▒pj▒▒`k▒:▒l▒▒▒mv▒n▒▒▒oU▒▒p▒▒▒q5▒▒ro▒▒s▒▒tOy▒t▒▒pv8▒`v▒▒pxx`x▒▒py▒Z`z▒▒p{▒<`|~gp}▒`~^Ip▒`▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
▒▒▒▒LMTEDTESTEWTEPT
EST5EDT,M3.2.0,M11.1.0
[goose@Vergil: /docker/config/vnstatdb ] $ docker exec -it vnstat date
Mon Feb 7 01:27:29 UTC 2022
[goose@Vergil: /docker/config/vnstatdb ] $
Not sure where my issue is, any ideas?
Appreciate you work on this project. Wondering if it is possible to add the container name in front of the interface name and then sort them alphabetically. I have multiple servers each with 50+ containers. Saves the step of looking up the container interface name to find it in the UI.
Hi!
I see it's possible to ignore interfaces based on name with
docker exec vnstat vnstat -i br-20f8582bfc70 --remove --force
It would be cool if we could ignore based on a pattern.
docker exec vnstat vnstat -i veth* --remove --force
My usecase is that I'm using this on a system with podman and would like to ignore interfaces matching veth*
(ignoring all container created interfaces) as these names are not static and are dynamically created.
Given the recent dockerhub announcement of removing free team orgs, I'm wondering if the current org will be affected? And if so perhaps this could have a high priority? There are other options to use like GHCR or Quay.
Can you add the options -i/-iface for the selected interface ?
Thanks for the work on this repo.
How can I access the vnstat.conf file normally stored under /etc/vnstat.conf?
Thanks in advance.
I'm running a traefik reverse proxy for all my webservices. All my applications are properly dockered and do not have access to the hosts network stack (including traefik). Now obviously vnstat needs to to run on the host network to collect it's data, but the lighthttp doesn't. This makes it impossible for traefik to properly route incoming requests to lighthttp, since it can't access services bound to 127.0.0.1
on the host network. I could of course listen to multiple IP addresses but I don't have any that is only reachable by traefik, so I would have to bind lighthttp to a public interface or deploy firewall rules.
Since vnstati doesn't appear to need access to the vnstatd process, I would suggest moving lighthttp into it's own container and have them share the same volume. It would also allow to only run vnstatd or vnstati and not have to have have the database on the same host.
I have observed that thttpd has a memory footprint of up to 148MiB. What are the advantages of this program?
I have multiple servers. When I want to concentrate all the network cards that need attention in a domain name, the current directory structure makes me wonder how to use Nginx for reverse proxy. There may be a way to do a reverse proxy, but that should be more troublesome.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.