Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Plugin] Network Stats

Featured Replies

Is there a way to persist data? 

  • 2 months later...
  • Replies 311
  • Views 81.5k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • new release is out there, its rough, but it brings this plugin back to life from having additional steps to get it working.  Any and all feedback is appreciated and will be considered.

  • currently because of dependency changes from 6.9 to 6.10, this plugin isnt fully working by itself at least the image outputs arent.  in order to fix the outputs you would have to install the missing

  • outrigger999
    outrigger999

    Installing the dependencies worked for me. There is however a typo in the above script which has to do with the install of freetype-2.6.3. Find the line below in the above script and you will notice i

Posted Images

Worked, need wait sometime.

Thanks!

 

Edited by aludov
Correct reply

  • 5 months later...
On 7/30/2020 at 5:56 AM, fmp4m said:

I have began having an odd problem where my Network Stats are not working.  They say

"vnstat service must berunning STARTED to view network stats."

 

So I checked:

/etc/rc.d/rc.vnstat start

 

received: 

Error: Not enough free diskspace available in "/var/lib/vnstat/", exiting.

 

My array/cache/ has plenty of space far beyond any need this would have so I checked:

ls -l /var/lib/vnstat
total 4
-rw-r--r-- 1 root root 0 Jul 29 16:49 vnstat.db
 

Any ideas?

 

I occured the same problem, and solved by changing the default DatabaseDir '/var/lib/vnstat' to '/mnt/user/vnstat' in /etc/vnstat.conf. 

The new DatabaseDir ‘/mnt/user/vnstat’ was created in UNRAID WEBGUI shares tab.

 

Though I still don't understand why default DatabaseDir failed. Hope someone could enlight me.

 

  • 3 weeks later...
On 7/30/2020 at 3:59 AM, Grohmand said:

Is there a way to persist data? 

Was looking for this as well. Any update?

  • 1 month later...
On 4/15/2020 at 6:54 PM, dorgan said:

I have added the ability to add pretty much any interface to be tracked.  I have also added the ability to add an alias to an interface that is used on the graphs.  I have found some information on how identify which veth interface maps to a given docker container, but it does not seem consistent, if someone knows an easy way, then maybe I can add this to the interface.

Settings-Page_2020-04-15.thumb.png.8d9f83c89b994a7f4fecf3a08c51ef25.png

 

Stats-Page_2020-04-15.thumb.png.dae2dd2ec31dfa1a0fd9ef62775139a7.png

 

Hello,

 

I manage to autofill Alias with a script

 

for container in $(docker ps --format '{{.ID}}'); do
  veth=""
  networkmode=$(docker inspect -f "{{.HostConfig.NetworkMode}}" $container)
  name=$(docker ps --filter "id=$container" --format "{{.Names}}")
  if [ "$networkmode" == "host" ]; then
    veth="host"
  elif [ "$networkmode" == "br0" ]; then
    veth="br0"
  else
    pid=$(docker inspect --format '{{.State.Pid}}' "$container")
    ifindex=$(nsenter -t $pid -n ip link | sed -n -e 's/.*eth0@if\([0-9]*\):.*/\1/p')
    if [ -z "$ifindex" ]; then
      veth="not found"
    else
      veth=$(ip -o link | grep ^$ifindex | sed -n -e 's/.*\(veth[[:alnum:]]*\).*/\1/p')
    fi
  fi
  if [[ "$veth" = "veth"* ]]; then
    echo $container : $name : $veth
    sed -i "/$name/d" /boot/config/plugins/networkstats/networkstats.cfg
    sed -i "/alias-$veth/d" /boot/config/plugins/networkstats/networkstats.cfg
    echo "alias-"$veth"="\"$name\" >> /boot/config/plugins/networkstats/networkstats.cfg
  fi
done

 

Edited by Meldrak
script mod

  • 3 weeks later...
  • Author
On 5/21/2021 at 9:07 AM, Meldrak said:

 

Hello,

 

I manage to autofill Alias with a script

 


for container in $(docker ps --format '{{.ID}}'); do
  veth=""
  networkmode=$(docker inspect -f "{{.HostConfig.NetworkMode}}" $container)
  name=$(docker ps --filter "id=$container" --format "{{.Names}}")
  if [ "$networkmode" == "host" ]; then
    veth="host"
  elif [ "$networkmode" == "br0" ]; then
    veth="br0"
  else
    pid=$(docker inspect --format '{{.State.Pid}}' "$container")
    ifindex=$(nsenter -t $pid -n ip link | sed -n -e 's/.*eth0@if\([0-9]*\):.*/\1/p')
    if [ -z "$ifindex" ]; then
      veth="not found"
    else
      veth=$(ip -o link | grep ^$ifindex | sed -n -e 's/.*\(veth[[:alnum:]]*\).*/\1/p')
    fi
  fi
  if [[ "$veth" = "veth"* ]]; then
    sed -i "/$veth/c\alias-$veth='$name'" /boot/config/plugins/networkstats/networkstats.cfg
  fi
done

 

This is nice, maybe I will rework some of this into identifying applications, and then you can just select which applications to track.  Do you know if the network device change upon reboot??

On 6/7/2021 at 11:40 PM, dorgan said:

This is nice, maybe I will rework some of this into identifying applications, and then you can just select which applications to track.  Do you know if the network device change upon reboot??

 

Yes the network device name change on reboot or docker update

My script just fill the docker name to the veth device in the config file

It doesn't auto select the device you want to track, you need to select it in your plugin and hit save

 

I updated the script in previous post to delete the old entry if there's one

  • 3 weeks later...

Can somebody support me in this case?

 

My network stat get not complete displayed...

 

 

Best regards,

 

Phil

 

  • 2 weeks later...
On 7/2/2020 at 6:14 PM, DjBill said:

Hi, thanks for the plugin. This post https://forums.docker.com/t/relationship-between-interface-vethxxxxx-and-container/12872/25 explains how to correlate "vethxxxxx" interfaces and "docker".
This post also have some script that might  help you on the development.

 

 

Following the link above has a comment and link to the following Github -- https://github.com/cslev/find_veth_docker

 

As I'm very new to Unraid and Linux, can someone please help me understand where I would enter this information in? I tried in the terminal for Unraid and also the console of one of the dockers I'm trying to figure out the Veth..

 

In both locations I've tried entering.. 

sudo ./find_veth_docker.sh -n nextcloud

On 7/15/2021 at 9:58 AM, ThatTallGuy21 said:

 

Following the link above has a comment and link to the following Github -- https://github.com/cslev/find_veth_docker

 

As I'm very new to Unraid and Linux, can someone please help me understand where I would enter this information in? I tried in the terminal for Unraid and also the console of one of the dockers I'm trying to figure out the Veth..

 

In both locations I've tried entering.. 

sudo ./find_veth_docker.sh -n nextcloud

So after additional research I found that Veth##### changes each time a container restarts, so unless this is able to be persisted, then I'm not going to worry about this too much. Would like to know how to quickly find it, using the above, but not completely needed. 

  • 4 weeks later...

I did some little changes to my script, and now data persist on containers restarts and on interfaces name changes

Before running my script as a CRON job (every day is a good choice), you'll need to setup the plugin once with interfaces you'd like to show

To persist on array reboot, you'll also need to run script after docker finish starting all containers

 

https://github.com/Meldrak/user-scripts/blob/main/networkstats

 

On 6/7/2021 at 11:40 PM, dorgan said:

This is nice, maybe I will rework some of this into identifying applications, and then you can just select which applications to track.  Do you know if the network device change upon reboot??

 

  • 3 weeks later...

Hello,

 

the page Stats -> Network Stats only shows two empty/non-existing images (placeholder).

I already re-installed the plugin but it did not help.

Recently i changed my mainboard from multi LAN to single LAN.

Re-configuration and even a manual edit of the interface in /etc/vnstat.conf did not help. Debug of vnstat says, logging is of traffic is fine.

Unraid Version is 6.10-rc1.

 

Thanks for help!

  • Author
21 minutes ago, Twix said:

Hello,

 

the page Stats -> Network Stats only shows two empty/non-existing images (placeholder).

I already re-installed the plugin but it did not help.

Recently i changed my mainboard from multi LAN to single LAN.

Re-configuration and even a manual edit of the interface in /etc/vnstat.conf did not help. Debug of vnstat says, logging is of traffic is fine.

Unraid Version is 6.10-rc1.

 

Thanks for help!

It takes a while for the graphs to start showing up the first time.

Ah, thank you for that info! I will monitor that :)

On 10/5/2020 at 4:44 AM, aludov said:

Worked, need wait sometime.

Thanks!

 

How long did you wait? I’ve had mine installed for 2 days and still a blank screen. 

Same here!
Still no content.

+1 here no content too 

  • Author
5 minutes ago, adamgwaps said:

+1 here no content too 

Have you gone into the setting and selected which adapters to monitor?

Yes. ETH0.
even checked the vnstat.conf.

6.10 Rc1 and no content as well. and yes i have eth0 selected and the daemon is running.

  • 2 weeks later...

does noone have an idea how to fix this? 😕

  • 2 weeks later...

:(

  • 4 weeks later...

I'm also seeing the same issue with the stats images not loading.

Trying "vnstati" on the commandline returns:

vnstati: error while loading shared libraries: libgd.so.3: cannot open shared object file: No such file or directory

 

So i assume this is why the images no longer load but a quick google about that error code and I couldn't find a fix unfortunately.

  • Author
14 minutes ago, Migz93 said:

I'm also seeing the same issue with the stats images not loading.

Trying "vnstati" on the commandline returns:

vnstati: error while loading shared libraries: libgd.so.3: cannot open shared object file: No such file or directory

 

So i assume this is why the images no longer load but a quick google about that error code and I couldn't find a fix unfortunately.

What version of unraid are you running??  I just did a clean install of the plugin and everything is working on 6.9.2

3 minutes ago, dorgan said:

What version of unraid are you running??  I just did a clean install of the plugin and everything is working on 6.9.2

Sorry, I should've mentioned that initially.

6.10.0-rc1 so likely just an issue with the latest version of Unraid.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.