Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Report of network traffic by email

    Scheduled Pinned Locked Moved Traffic Monitoring
    5 Posts 5 Posters 4.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jopeme
      last edited by

      Is there a package that reports network traffic and send them by email? I have installed ntopng 3.0 but i don't find this option.Lightsquid does not have this option. I use squid + squidguard + captive portal and i have several vlans configured on my pfsense 2.4

      Thanks.

      1 Reply Last reply Reply Quote 0
      • H
        highc
        last edited by

        You can do this with vnstat (the Status_Traffic_Totals package) and the mailreport package.

        Install both, get vnstat going, and then under Status -> Email reports add a line that will mail you regularly (e.g., daily at midnight) the output of the commands

        /usr/local/bin/vnstat -i pppoe0; /usr/local/bin/vnstat -i pppoe0 -h
        

        which in this case would be the statistics for the pppoe0 interface.

        For mailreport to work, you need to have setup System -> Advanced -> Notifications (the SMTP part there).

        pfSense+ 24.03 on Netgate SG-2100 (replaced SG-2440)
        pfSense 2.6 on Super Micro 5018D-FN4T (retired)

        NogBadTheBadN 1 Reply Last reply Reply Quote 1
        • occamsrazorO
          occamsrazor
          last edited by

          Old thread but wanted to say thanks, this is very useful. In case anyone wonders, this is a sample output of what you see in the email:

          Current report: Daily vnstst interface statistics for PPPoE
          
          Command output: Daily interface statistics (/usr/local/bin/vnstat -i pppoe0; /usr/local/bin/vnstat -i pppoe0 -h)
          Database updated: Mon Sep 24 18:55:00 2018
          
             WAN (pppoe0) since 09/24/18
          
                    rx:  2.98 MiB      tx:  1.85 MiB      total:  4.83 MiB
          
             monthly
                               rx      |     tx      |    total    |   avg. rate
               ------------------------+-------------+-------------+---------------
                 Sep '18      2.98 MiB |    1.85 MiB |    4.83 MiB |    0.02 kbit/s
               ------------------------+-------------+-------------+---------------
               estimated         2 MiB |       1 MiB |       3 MiB |
          
             daily
                               rx      |     tx      |    total    |   avg. rate
               ------------------------+-------------+-------------+---------------
                   today      2.98 MiB |    1.85 MiB |    4.83 MiB |    0.58 kbit/s
               ------------------------+-------------+-------------+---------------
               estimated         2 MiB |       1 MiB |       3 MiB |
           WAN (pppoe0)                                                             18:55
            ^                                                                       r
            |                                                                       r
            |                                                                       r
            |                                                                       r
            |                                                                       rt
            |                                                                       rt
            |                                                                       rt
            |                                                                       rt
            |                                                                       rt
            |                                                                       rt
           -+--------------------------------------------------------------------------->
            |  19 20 21 22 23 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18
          
           h  rx (KiB)   tx (KiB)      h  rx (KiB)   tx (KiB)      h  rx (KiB)   tx (KiB)
          19          0          0    03          0          0    11          0          0
          20          0          0    04          0          0    12          0          0
          21          0          0    05          0          0    13          0          0
          22          0          0    06          0          0    14          0          0
          23          0          0    07          0          0    15          0          0
          00          0          0    08          0          0    16          0          0
          01          0          0    09          0          0    17          0          0
          02          0          0    10          0          0    18       3049       1894
          

          pfSense CE on Qotom Q355G4 8GB RAM/60GB SSD
          Ubiquiti Unifi wired and wireless network, APC UPSs
          Mac OSX and IOS devices, QNAP NAS

          1 Reply Last reply Reply Quote 0
          • johnpozJ
            johnpoz LAYER 8 Global Moderator
            last edited by

            Bluestacks is a app player to run android stuff on PCs and Mac - WTF could that have to do with having an email email you bandwidth use?

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.8, 24.11

            1 Reply Last reply Reply Quote 0
            • NogBadTheBadN
              NogBadTheBad @highc
              last edited by NogBadTheBad

              @highc said in Report of network traffic by email:

              You can do this with vnstat (the Status_Traffic_Totals package) and the mailreport package.

              Install both, get vnstat going, and then under Status -> Email reports add a line that will mail you regularly (e.g., daily at midnight) the output of the commands

              /usr/local/bin/vnstat -i pppoe0; /usr/local/bin/vnstat -i pppoe0 -h
              

              which in this case would be the statistics for the pppoe0 interface.

              For mailreport to work, you need to have setup System -> Advanced -> Notifications (the SMTP part there).

              Better still create a shell script and run it with what ever options you want:-

              [2.4.4-RELEASE][admin@pfsense] /root/scripts: more vnstat-daily
              #!/bin/csh
              foreach int ( igb0.2 igb0.3 igb0.4 igb0.5 igb0.6 igb0.7 enc0 pppoe0 )
              echo
              /usr/local/bin/vnstat -i $int -h
              echo
              end

              Andy

              1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.