Live network statistics through SSH?



  • Hi!

    I just bought a Raspberry Pi (my second, actually) and i was thinking of settting up an extra monitor and view live network statistics through SSH from my Pfsense router (and the RPI as a client). The problem is that i'm a FreeBSD newbie.

    Earlier i have tried the "top" syntax which works somewhat, but it would be alot better with graphs or at least more detailed network statistics such as current in/out, states and so forth. Does anyone know such a tool which is pretty easy to install (or already in Pfsense) that does this?



  • You could use the ntop package via the webUI to do it, and there is also Stauts->Traffic Graphs.

    I prefer to use the widgets on the pfSense webUI.  Add what you need and there's a pretty good dashboard of what's going on with the firewall.


  • Rebel Alliance Global Moderator

    you can install the vnstat

    
     vnstat -i em0
    Database updated: Tue Apr  2 16:13:01 2013
    
       em0 since 04/29/12
    
              rx:  185.76 GiB      tx:  866.99 GiB      total:  1.03 TiB
    
       monthly
                         rx      |     tx      |    total    |   avg. rate
         ------------------------+-------------+-------------+---------------
           Mar '13      9.00 GiB |   87.41 GiB |   96.41 GiB |  301.94 kbit/s
           Apr '13    133.70 MiB |    1.96 GiB |    2.09 GiB |  120.98 kbit/s
         ------------------------+-------------+-------------+---------------
         estimated      2.33 GiB |   35.04 GiB |   37.36 GiB |
    
       daily
                         rx      |     tx      |    total    |   avg. rate
         ------------------------+-------------+-------------+---------------
         yesterday     87.76 MiB |    1.53 GiB |    1.62 GiB |  157.09 kbit/s
             today     45.94 MiB |  435.36 MiB |  481.30 MiB |   67.54 kbit/s
         ------------------------+-------------+-------------+---------------
         estimated        66 MiB |     643 MiB |     709 MiB |
    
    
    
     vnstat -i em0 -h
     em0                                                                      16:15
      ^         t
      |         t
      |         t
      |         t
      |         t           t
      |         t           t
      |         t           t                       t
      |         t           t                       t
      |         t           t                       t
      |         t           t                       t
     -+--------------------------------------------------------------------------->
      |  17 18 19 20 21 22 23 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16
    
     h  rx (KiB)   tx (KiB)      h  rx (KiB)   tx (KiB)      h  rx (KiB)   tx (KiB)
    17       1740       1512    01       2004       2026    09       2985       4467
    18       2361       1750    02       1806       2564    10       3144       4573
    19      19643     752533    03       1749       2254    11       2658       3488
    20       1927       2817    04       1841       1851    12       2729       2079
    21       1892       1809    05       2032       1835    13       1841       1673
    22       4621      40680    06       1912       2714    14       2126       2868
    23      16816     467654    07      10062     355653    15       1818       1691
    00       4467      44405    08       3445      11285    16        496        444
    [2.1-BETA1][admin@pfsense.local.lan]/root(12):
    
    

    trafshow might be what your looking for?
    http://doc.pfsense.org/index.php/How_can_I_monitor_bandwidth_usage%3F#trafshow



  • Thanks for the answers, i had totally missed the Pfsense page with monitoring software. Nice!


  • Rebel Alliance Developer Netgate

    If you want to watch traffic realtime, use iftop. There's no formal package for it yet, since it's only usable from the console, but it's great for tracking down abusers while traffic is flowing.


  • Netgate Administrator

    Would you not be better off using pfflowd to export traffic data to some netflow analyser running on the Pi?
    I imagine you would end up with a set of pretty screens!  :) I don't know if the Pi has enough horsepower to do that. Fortunately there are so many people using them I'm sure someone has already tried.

    Steve


Locked