150b0 [Solved] Network monitoring tool - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Networking

Networking Network related discussions (including general TCP/IP stuff, routing, etc).

Reply
 
Thread Tools Display Modes
  #1  
Old May 16th, 2009, 04:31
wonslung wonslung is offline
Member
 
Join Date: May 2009
Posts: 826
Thanks: 32
Thanked 15 Times in 14 Posts
Default Network monitoring tool

I'm looking for a basic tool to monitor bandwidth on my machine so i can effectively set up altq. I remember using ntop of pfsense but it used to crash every 2-3 minutes...any thoughts?
all i really need is a graph showing my bandwidth throughout the day.
Reply With Quote
  #2  
Old May 16th, 2009, 08:46
hydra hydra is offline
Member
 
Join Date: Nov 2008
Location: Slovakia
Posts: 272
Thanks: 18
Thanked 24 Times in 21 Posts
Default

Try MRTG or zabbix. I'm working on a tool that measures per-IP usage (bandwidth / packet rate).
Reply With Quote
  #3  
Old May 16th, 2009, 09:09
wonslung wonslung is offline
Member
 
Join Date: May 2009
Posts: 826
Thanks: 32
Thanked 15 Times in 14 Posts
Default

i've used MRTG before.....it's been awhile.

I didn't need anything like that, i ended up using vnstat
thanks though, i WILL check out zabbix just because i've never seen it
Reply With Quote
  #4  
Old May 16th, 2009, 09:32
edhunter's Avatar
edhunter edhunter is offline
Junior Member
 
Join Date: Nov 2008
Location: Sofia, Bulgaria
Posts: 72
Thanks: 43
Thanked 7 Times in 6 Posts
Default

net/nload

"screenshot":
Code:
Device vlan13 [xx.xx.xx.xx] (8/8):
=========================================================================================================
Incoming:





                                                                        Curr: 0.29 kBit/s
                                                                        Avg: 0.60 kBit/s
                                                                        Min: 101.37 kBit/s
                                              .     ..                  Max: 3.64 MBit/s
  #|  .#| ..         ##...##    .  ...    ..||##   .##.  ..... ####     Ttl: 2.15 GByte
Outgoing:





                                                                        Curr: 25.83 kBit/s
                                                                        Avg: 66.96 kBit/s
                                                                        Min: 3.26 kBit/s
                                                                        Max: 0.56 kBit/s
                                                     .                  Ttl: 3.84 GByte
Reply With Quote
The Following User Says Thank You to edhunter For This Useful Post:
MG (May 16th, 2009)
  #5  
Old May 16th, 2009, 18:18
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,816
Thanks: 29
Thanked 1,882 Times in 1,329 Posts
Default

You're already running pf, so sysutils/pfstat should be a breeze. You can monitor altq queues with it as well. It produces mrtg-like jpg/png graphs for any time interval you want.
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Adminstrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
  #6  
Old May 16th, 2009, 23:22
Mel_Flynn Mel_Flynn is offline
Member
 
Join Date: Nov 2008
Location: Drachten, Netherlands
Posts: 379
Thanks: 7
Thanked 74 Times in 57 Posts
Default

And adding net/bmon for per interface statistics capable of being saved to a database, flat html and rrdtool.
Also, [file]sysutils/pftop[/port] view '8' is very useful for live monitoring of already existing queues, since the last time you reloaded the rules. Especially with borrows, it's good to see they are needed / being overloaded etc.
__________________
The core concept of freedom is the lack of rules, even those made to "protect freedom".

Last edited by phoenix; December 16th, 2010 at 07:16. Reason: Add port tags
Reply With Quote
The Following User Says Thank You to Mel_Flynn For This Useful Post:
prox (February 22nd, 2011)
  #7  
Old May 17th, 2009, 16:05
wonslung wonslung is offline
Member
 
Join Date: May 2009
Posts: 826
Thanks: 32
Thanked 15 Times in 14 Posts
Default

thanks for the suggestions guys =)
Reply With Quote
  #8  
Old May 17th, 2009, 20:34
wonslung wonslung is offline
Member
 
Join Date: May 2009
Posts: 826
Thanks: 32
Thanked 15 Times in 14 Posts
Default

well i tried pfstat but i can't seem to get any graphs..when i do pfstat -q i get nothing
not sure what i did wrong.

here is my config file


Code:
#
collect 1 = interface "em0" pass bytes in ipv4 diff
collect 2 = interface "em0" pass bytes out ipv4 diff
collect 3 = global states entries

image "/usr/local/www/basic/pfstat/pfstat_day.jpg" {
        from 1 days to now
        width 980 height 200
        left
                graph 1 "in" "bytes/s" color 0 192 0 filled,
                graph 2 "out" "bytes/s" color 0 0 255
        right
                graph 3 "states" "entries" color 192 192 0
}

image "/usr/local/www/basic/pfstat/pfstat_week.jpg" {
        from 1 weeks to now
        width 980 height 200
        left
                graph 1 "in" "bytes/s" color 0 192 0 filled,
                graph 2 "out" "bytes/s" color 0 0 255
        right
                graph 3 "states" "entries" color 192 192 0
}

image "/usr/local/www/basic/pfstat/pfstat_month.jpg" {
        from 1 months to now
        width 980 height 200
        left
                graph 1 "in" "bytes/s" color 0 192 0 filled,
                graph 2 "out" "bytes/s" color 0 0 255
        right
                graph 3 "states" "entries" color 192 192 0
}

#
collect 4 = interface "em0" pass packets in ipv4 diff
collect 5 = interface "em0" pass packets out ipv4 diff
collect 6 = interface "em0" block packets in ipv4 diff
collect 7 = interface "em0" block packets out ipv4 diff

image "/usr/local/www/basic/pfstat/pfstat-packets_day.jpg" {
        from 1 days to now
        width 980 height 200
        left
          graph 4 "pass in"   "packets/s" color 0 192 0 filled,
                graph 5 "pass out"  "packets/s" color 0 0 255
        right
                graph 6 "block in"  "packets/s" color 255 0 0,
                graph 7 "block out" "packets/s" color 192 192 0
}

image "/usr/local/www/basic/pfstat/pfstat-packets_week.jpg" {
        from 1 weeks to now
        width 980 height 200
        left
                graph 4 "pass in"   "packets/s" color 0 192 0 filled,
                graph 5 "pass out"  "packets/s" color 0 0 255
        right
                graph 6 "block in"  "packets/s" color 255 0 0,
                graph 7 "block out" "packets/s" color 192 192 0
}

image "/usr/local/www/basic/pfstat/pfstat-packets_month.jpg" {
        from 1 months to now
        width 980 height 200
        left
                graph 4 "pass in"   "packets/s" color 0 192 0 filled,
                graph 5 "pass out"  "packets/s" color 0 0 255
        right
                graph 6 "block in"  "packets/s" color 255 0 0,
                graph 7 "block out" "packets/s" color 192 192 0
}

#
collect  8 = global states inserts  diff
collect  9 = global states removals diff
collect 10 = global states searches diff

image "/usr/local/www/basic/pfstat/pfstat-states_day.jpg" {
        from 1 days to now
        width 980 height 200
        left
                graph 8 "inserts" "states/s" color 0 192 0 filled,
                graph 9 "removals" "states/s" color 0 0 255
        right
                graph 10 "searches" "states/s" color 255 0 0
}
 
image "/usr/local/www/basic/pfstat/pfstat-states_week.jpg" {
        from 1 weeks to now
        width 980 height 200
        left
                graph 8 "inserts" "states/s" color 0 192 0 filled,
                graph 9 "removals" "states/s" color 0 0 255
        right
                graph 10 "searches" "states/s" color 255 0 0
}
 
image "/usr/local/www/basic/pfstat/pfstat-states_week.jpg" {
        from 1 weeks to now
        width 980 height 200
        left
                graph 8 "inserts" "states/s" color 0 192 0 filled,
                graph 9 "removals" "states/s" color 0 0 255
        right
                graph 10 "searches" "states/s" color 255 0 0
}

image "/usr/local/www/basic/pfstat/pfstat-states_month.jpg" {
        from 1 months to now
        width 980 height 200
        left
                graph 8 "inserts" "states/s" color 0 192 0 filled,
                graph 9 "removals" "states/s" color 0 0 255
        right
                graph 10 "searches" "states/s" color 255 0 0
}

#
collect 15 = global counters match          diff
collect 16 = global counters bad-offset     diff
collect 17 = global counters fragment       diff
collect 18 = global counters short          diff
collect 19 = global counters normalize      diff
collect 20 = global counters memory         diff
collect 21 = global counters bad-timestamp  diff
collect 22 = global counters congestion     diff
collect 23 = global counters ip-option      diff
collect 24 = global counters proto-cksum    diff
collect 25 = global counters state-mismatch diff
collect 26 = global counters state-insert   diff
collect 27 = global counters state-limit    diff
collect 28 = global counters src-limit      diff
collect 29 = global counters synproxy       diff

image "/usr/local/www/basic/pfstat/pfstat-errors_day.jpg" {
       from 1 days to now
       width 980 height 200
        left
               graph 17 "frag" "/s" color 192 0 192,
               graph 22 "cong" "/s" color 0 192 192,
               graph 23 "iopt" "/s" color 0 0 255,
               graph 24 "csum" "/s" color 192 192 0,
               graph 25 "mism" "/s" color 255 0 0
#        
        right
               graph 15 "match" "/s" color 0 192 0
}

image "/usr/local/www/basic/pfstat/pfstat-errors_week.jpg" {
        from 1 weeks to now
        width 980 height 200
        left
                graph 17 "frag" "/s" color 192 0 192,
                graph 22 "cong" "/s" color 0 192 192,
                graph 23 "iopt" "/s" color 0 0 255,
                graph 24 "csum" "/s" color 192 192 0,
                graph 25 "mism" "/s" color 255 0 0
#               others are usually all zero here
        right
                graph 15 "match" "/s" color 0 192 0
}

image "/usr/local/www/basic/pfstat/pfstat-errors_month.jpg" {
        from 1 months to now
        width 980 height 200
        left
                graph 17 "frag" "/s" color 192 0 192,
                graph 22 "cong" "/s" color 0 192 192,
                graph 23 "iopt" "/s" color 0 0 255,
                graph 24 "csum" "/s" color 192 192 0,
                graph 25 "mism" "/s" color 255 0 0
        right
                graph 15 "match" "/s" color 0 192 0
}
#######################################################
#######################################################
and my crontab
Code:
*    *    *   *   *   /usr/local/bin/pfstat -q -d /var/db/pfstat.db
10   6-19 *   *   *   /usr/local/bin/pfstat -p -d /var/db/pfstat.db
25   3    *   *   *   /usr/local/bin/pfstat -t 30 -d /var/db/pfstat.db
Reply With Quote
  #9  
Old May 17th, 2009, 20:46
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Administrator
 
Join Date: Nov 2008
Location: Rotterdam, the Netherlands
Posts: 9,816
Thanks: 29
Thanked 1,882 Times in 1,329 Posts
Default

You will have to keep numbering on, not reuse 1, 2, 3 every time. Example:

Code:
     collect 1 = interface "em0" pass bytes in ipv4 diff
     collect 2 = interface "em0" pass bytes out ipv4 diff
     image "/usr/local/www/data/bandwidth_em0_day.png" {
             from 24 hours to now
             type png
             width 800 height 320
             left
                     graph 1 bps "in" "bits/s" color 0 192 0 filled
             right
                     graph 2 bps "out" "bits/s" color 0 0 255
     }

     collect 3 = interface "em1" pass bytes in ipv4 diff
     collect 4 = interface "em1" pass bytes out ipv4 diff
     image "/usr/local/www/data/bandwidth_em1_day.png" {
             from 24 hours to now
             type png
             width 800 height 320
             left
                     graph 3 bps "in" "bits/s" color 0 192 0 filled
             right
                     graph 4 bps "out" "bits/s" color 0 0 255
     }

     collect 5 = interface "em0" pass bytes in ipv4 diff
     collect 6 = interface "em0" pass bytes out ipv4 diff
     image "/usr/local/www/data/bandwidth_em0_week.png" {
             from 7 days to now
             type png
             width 800 height 320
             left
                     graph 5 bps "in" "bits/s" color 0 192 0 filled
             right
                     graph 6 bps "out" "bits/s" color 0 0 255
     }


     collect 7 = interface "em1" pass bytes in ipv4 diff
     collect 8 = interface "em1" pass bytes out ipv4 diff
     image "/usr/local/www/data/bandwidth_em1_week.png" {
             from 7 days to now
             type png
             width 800 height 320
             left
                     graph 7 bps "in" "bits/s" color 0 192 0 filled
             right
                     graph 8 bps "out" "bits/s" color 0 0 255
     }

     collect 9 = global states entries
     image "/usr/local/www/data/states.png" {
             from 24 hours to now
             type png
             width 800 height 320
             left
                    graph 9 "states" "entries" color 200 0 0 filled
     }
etc. Every graph n needs a collect n.

You can use pfstat -vp and pfstat -vq for more info. I advise the use of png, much more lightweight. You can easily run -q every minute and -p every five minutes. I'm doing that on servers doing 125+ Mbit/s, and it's not even registering in 'top'.
__________________
FreeBSD Forums: Information for New Members | FreeBSD Forums Rules
FreeBSD Resources: The FreeBSD Handbook | Manuals | FAQ | Wiki
Before you post: How to ask questions the smart way
If you must know .. So, what does an Adminstrator/Moderator do?
---> Do not PM me with FreeBSD questions. I do not work here. <---
Reply With Quote
The Following User Says Thank You to DutchDaemon For This Useful Post:
Enter4 (January 13th, 2013)
  #10  
Old December 16th, 2010, 06:32
kiranopatil kiranopatil is offline
Junior Member
 
Join Date: Jan 2010
Location: India, Bangalore
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Try iftop.......
__________________
Regards
Kiran Patil
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Use swat (Samba admin tool) over network? michaelrmgreen Web & Network Services 4 December 15th, 2010 15:41
performance monitoring jwhitt General 1 November 2nd, 2010 07:04
Webserver monitoring solar_illuminations Web & Network Services 18 May 5th, 2010 17:24
Monitoring Bandwidth atwinix Networking 4 October 14th, 2009 00:06
Serious network monitoring tool Mad_Dud Networking 2 April 25th, 2009 20:34


All times are GMT +1. The time now is 07:30.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0