Network monitoring tool

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

Network monitoring tool

Postby wonslung » 16 May 2009, 03:31

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.
wonslung
Member
 
Posts: 850
Joined: 07 May 2009, 00:15

Postby hydra » 16 May 2009, 07:46

Try MRTG or zabbix. I'm working on a tool that measures per-IP usage (bandwidth / packet rate).
hydra
Member
 
Posts: 272
Joined: 17 Nov 2008, 08:50
Location: Slovakia

Postby wonslung » 16 May 2009, 08:09

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
wonslung
Member
 
Posts: 850
Joined: 07 May 2009, 00:15

Postby edhunter » 16 May 2009, 08:32

[port]net/nload[/port] :)

"screenshot":
Code: Select all
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
User avatar
edhunter
Junior Member
 
Posts: 72
Joined: 17 Nov 2008, 09:31
Location: Sofia, Bulgaria

Postby DutchDaemon » 16 May 2009, 17:18

You're already running pf, so [port]sysutils/pfstat[/port] 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.
User avatar
DutchDaemon
Old Fart
 
Posts: 10467
Joined: 16 Nov 2008, 20:17
Location: The Netherlands

Postby Mel_Flynn » 16 May 2009, 22:22

And adding [port]net/bmon[/port] 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".
Mel_Flynn
Member
 
Posts: 379
Joined: 18 Nov 2008, 18:02
Location: Drachten, Netherlands

Postby wonslung » 17 May 2009, 15:05

thanks for the suggestions guys =)
wonslung
Member
 
Posts: 850
Joined: 07 May 2009, 00:15

Postby wonslung » 17 May 2009, 19:34

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: Select all
#
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: Select all
*    *    *   *   *   /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

wonslung
Member
 
Posts: 850
Joined: 07 May 2009, 00:15

Postby DutchDaemon » 17 May 2009, 19:46

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

Code: Select all
     collect [B]1[/B] = interface "em0" pass bytes in ipv4 diff
     collect [B]2[/B] = 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 [B]1[/B] bps "in" "bits/s" color 0 192 0 filled
             right
                     graph [B]2[/B] bps "out" "bits/s" color 0 0 255
     }

     collect [B]3[/B] = interface "em1" pass bytes in ipv4 diff
     collect [B]4[/B] = 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 [B]3[/B] bps "in" "bits/s" color 0 192 0 filled
             right
                     graph [B]4[/B] bps "out" "bits/s" color 0 0 255
     }

     collect [B]5[/B] = interface "em0" pass bytes in ipv4 diff
     collect [B]6[/B] = 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 [B]5[/B] bps "in" "bits/s" color 0 192 0 filled
             right
                     graph [B]6[/B] bps "out" "bits/s" color 0 0 255
     }


     collect [B]7[/B] = interface "em1" pass bytes in ipv4 diff
     collect [B]8[/B] = 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 [B]7[/B] bps "in" "bits/s" color 0 192 0 filled
             right
                     graph [B]8[/B] bps "out" "bits/s" color 0 0 255
     }

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


etc. Every graph n needs a collect n.

You can use [cmd=]pfstat -vp[/cmd] and [cmd=]pfstat -vq[/cmd] 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'.
User avatar
DutchDaemon
Old Fart
 
Posts: 10467
Joined: 16 Nov 2008, 20:17
Location: The Netherlands

Postby kiranopatil » 16 Dec 2010, 05:32

Try iftop.......:)
Regards
Kiran Patil
kiranopatil
Junior Member
 
Posts: 11
Joined: 19 Jan 2010, 07:03
Location: India, Bangalore


Return to Networking

Who is online

Users browsing this forum: No registered users and 2 guests