Re: MRTG monitoring specific ports

2004-10-29 Thread Spades
Thanks, i think its well done, but i couldn't get it to work.
I have refreshed the mrtg page but doesn't seem to have the lines.
See http://mojito.purplecards.com/mrtg
http://mojito.purplecards.com/ipfwmrtg.php (you told me to create)
# cat mrtg.cfg | grep [EMAIL PROTECTED]
# ipfw -at list
2  00  count tcp from me 25 to any
3  00  count tcp from any to me 25
4  00  count tcp from me 110 to any
5  00  count tcp from any to me 110
6  00  count tcp from me 80 to any
7  00  count tcp from any to me 80
8  00  count udp from me 53 to any
9  00  count udp from any to me 53
65535 138410 17490211 Fri Oct 29 17:44:31 2004 allow ip from any to any
I have php.4.39 installed, please advise, thanks.
Spades
- Original Message - 
From: Gerard D. [EMAIL PROTECTED]
To: Spades [EMAIL PROTECTED]
Sent: Thursday, October 28, 2004 2:50 PM
Subject: Re: MRTG monitoring specific ports


I'm sure theres something better out there.. but heres a little script
I threw togethor a long long long time ago for use on my webservers..
I know its nasty and could easily be done in a better language but i'm
lazy as hell.. anyway it assumes you have ipfw support enabled and the
command line version of php installed.
/*** start ipfwmrtg.php */
#!/usr/local/bin/php
?php
$ipfw_out = shell_exec(ipfw show .$_SERVER['argv'][1].
.$_SERVER['argv'][2]);
$regexp = /([\d]+)[\s]+([\d]+)[\s]+([\d]+)[\s]+.+/;
$ipfw = split(\n, $ipfw_out);
foreach($ipfw as $pp) {
   preg_match($regexp, $pp, $out);
   $tmp[] = $out[3];
}
//print_r($tmp);
//echo fdc-bw 1 $tmp[1] $tmp[0] 0 0;
echo $tmp[1].\n;
echo $tmp[0].\n;
echo 1.\n;
echo name.\n;
/** end ipfwmrtg.php ***/
/// code that goes in your mrtg.cfg
Title[smtp]: smtp total stats
Target[smtp]: `/usr/local/etc/mrtg/ipfwmrtg.php 2 3`
MaxBytes[smtp]: 1500
PageTop[smtp]: h1smtp/h1
Title[pop3]: pop3 total stats
Target[pop3]: `/usr/local/etc/mrtg/ipfwmrtg.php 4 5`
MaxBytes[pop3]: 1500
PageTop[pop3]: h1pop3/h1
Title[http]: http total stats
Target[http]: `/usr/local/etc/mrtg/ipfwmrtg.php 6 7`
MaxBytes[http]: 1500
PageTop[http]: h1http/h1
Title[dns]: dns total stats
Target[dns]: `/usr/local/etc/mrtg/ipfwmrtg.php 8 9`
MaxBytes[dns]: 1500
PageTop[dns]: h1dns/h1
// end code for mrtg.cfg
so anyway now that you have the code you'll need to add a couple ipfw 
rules..

something like
ipfw add 2 count tcp from me 25 to any
ipfw add 3 count tcp from any to me 25
ipfw add 4 count tcp from me 110 to any
ipfw add 5 count tcp from any to me 110
ipfw add 6 count tcp from me 80 to any
ipfw add 7 count tcp from any to me 80
ipfw add 8 count udp from me 53 to any
ipfw add 9 count udp from any to me 53
would count all traffic going out of your server on port 25 and the
second line would count all inbound traffic to your server on port
25..
You can add as many rules as you'd like just change the numbers for
each new rule.. You will also need to update the #'s for the new rules
in the Target[]: line that goes into mrtg.conf
Okay Well i'm not good at explaining things.. I hope this can help
you. good luck
-Gerard

On Thu, 28 Oct 2004 02:15:09 +0800, Spades [EMAIL PROTECTED] wrote:
Hi,
Is there anyway for us to trace the server bandwidth based on
specific ports on a MRTG graph?
Such as smtp bandwidth? port 25
pop3 bandwidth? port 110
web bandwidth? port 80
dns bandwidth? port 53
Is there any program or can MRTG do, please advise, thanks.
--
Spades
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED]

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: MRTG monitoring specific ports

2004-10-29 Thread Spades
I have pasted the Error:
# /usr/local/mrtg-2/bin/mrtg 
/home/www/mojito.purplecards.com/mrtg/cfg/mrtg.cfg

3: not found
WARNING: Problem with External get '/usr/local/etc/mrtg/ipfwmrtg.php 2 3':
  Expected a Number for 'in' but got ''
5: not found
WARNING: Problem with External get '/usr/local/etc/mrtg/ipfwmrtg.php 4 5':
  Expected a Number for 'in' but got ''
7: not found
WARNING: Problem with External get '/usr/local/etc/mrtg/ipfwmrtg.php 6 7':
  Expected a Number for 'in' but got ''
9: not found
WARNING: Problem with External get '/usr/local/etc/mrtg/ipfwmrtg.php 8 9':
  Expected a Number for 'in' but got ''
ERROR: Target[smtp][_IN_] ' $target-[1]{$mode} ' did not eval into defined 
data
ERROR: Target[pop3][_IN_] ' $target-[2]{$mode} ' did not eval into defined 
data
ERROR: Target[http][_IN_] ' $target-[3]{$mode} ' did not eval into defined 
data
ERROR: Target[dns][_IN_] ' $target-[4]{$mode} ' did not eval into defined 
data

- Original Message - 
From: Spades [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, October 29, 2004 5:46 PM
Subject: Re: MRTG monitoring specific ports


Thanks, i think its well done, but i couldn't get it to work.
I have refreshed the mrtg page but doesn't seem to have the lines.
See http://mojito.purplecards.com/mrtg
http://mojito.purplecards.com/ipfwmrtg.php (you told me to create)
# cat mrtg.cfg | grep [EMAIL PROTECTED]
# ipfw -at list
2  00  count tcp from me 25 to any
3  00  count tcp from any to me 25
4  00  count tcp from me 110 to 
any
5  00  count tcp from any to me 
110
6  00  count tcp from me 80 to any
7  00  count tcp from any to me 80
8  00  count udp from me 53 to any
9  00  count udp from any to me 53
65535 138410 17490211 Fri Oct 29 17:44:31 2004 allow ip from any to any

I have php.4.39 installed, please advise, thanks.
Spades
- Original Message - 
From: Gerard D. [EMAIL PROTECTED]
To: Spades [EMAIL PROTECTED]
Sent: Thursday, October 28, 2004 2:50 PM
Subject: Re: MRTG monitoring specific ports


I'm sure theres something better out there.. but heres a little script
I threw togethor a long long long time ago for use on my webservers..
I know its nasty and could easily be done in a better language but i'm
lazy as hell.. anyway it assumes you have ipfw support enabled and the
command line version of php installed.
/*** start ipfwmrtg.php */
#!/usr/local/bin/php
?php
$ipfw_out = shell_exec(ipfw show .$_SERVER['argv'][1].
.$_SERVER['argv'][2]);
$regexp = /([\d]+)[\s]+([\d]+)[\s]+([\d]+)[\s]+.+/;
$ipfw = split(\n, $ipfw_out);
foreach($ipfw as $pp) {
   preg_match($regexp, $pp, $out);
   $tmp[] = $out[3];
}
//print_r($tmp);
//echo fdc-bw 1 $tmp[1] $tmp[0] 0 0;
echo $tmp[1].\n;
echo $tmp[0].\n;
echo 1.\n;
echo name.\n;
/** end ipfwmrtg.php ***/
/// code that goes in your mrtg.cfg
Title[smtp]: smtp total stats
Target[smtp]: `/usr/local/etc/mrtg/ipfwmrtg.php 2 3`
MaxBytes[smtp]: 1500
PageTop[smtp]: h1smtp/h1
Title[pop3]: pop3 total stats
Target[pop3]: `/usr/local/etc/mrtg/ipfwmrtg.php 4 5`
MaxBytes[pop3]: 1500
PageTop[pop3]: h1pop3/h1
Title[http]: http total stats
Target[http]: `/usr/local/etc/mrtg/ipfwmrtg.php 6 7`
MaxBytes[http]: 1500
PageTop[http]: h1http/h1
Title[dns]: dns total stats
Target[dns]: `/usr/local/etc/mrtg/ipfwmrtg.php 8 9`
MaxBytes[dns]: 1500
PageTop[dns]: h1dns/h1
// end code for mrtg.cfg
so anyway now that you have the code you'll need to add a couple ipfw 
rules..

something like
ipfw add 2 count tcp from me 25 to any
ipfw add 3 count tcp from any to me 25
ipfw add 4 count tcp from me 110 to any
ipfw add 5 count tcp from any to me 110
ipfw add 6 count tcp from me 80 to any
ipfw add 7 count tcp from any to me 80
ipfw add 8 count udp from me 53 to any
ipfw add 9 count udp from any to me 53
would count all traffic going out of your server on port 25 and the
second line would count all inbound traffic to your server on port
25..
You can add as many rules as you'd like just change the numbers for
each new rule.. You will also need to update the #'s for the new rules
in the Target[]: line that goes into mrtg.conf
Okay Well i'm not good at explaining things.. I hope this can help
you. good luck
-Gerard

On Thu, 28 Oct 2004 02:15:09 +0800, Spades [EMAIL PROTECTED] wrote:
Hi,
Is there anyway for us to trace the server bandwidth based on
specific ports on a MRTG graph?
Such as smtp bandwidth? port 25
pop3 bandwidth? port 110
web bandwidth? port 80
dns bandwidth? port 53
Is there any program or can MRTG do, please advise, thanks.
--
Spades
___
[EMAIL PROTECTED

Re: MRTG monitoring specific ports

2004-10-28 Thread Aaron P. Martinez
On Wed, 2004-10-27 at 23:34, Spades wrote:
 Thanks, how do i install this and view the MRTG of
 the port 25, 110, etc.
 
 - Original Message - 
 From: Joe Marcus Clarke [EMAIL PROTECTED]
 To: Spades [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, October 28, 2004 2:22 AM
 Subject: Re: MRTG monitoring specific ports
 
 
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1
 
  Spades wrote:
  | Hi,
  |
  | Is there anyway for us to trace the server bandwidth based on
  | specific ports on a MRTG graph?
  |
  | Such as smtp bandwidth? port 25
  | pop3 bandwidth? port 110
  | web bandwidth? port 80
  | dns bandwidth? port 53
  |
  | Is there any program or can MRTG do, please advise, thanks.
 
  I use net/ntop of this.  Ntop can also output Netflow data or RRDTool
  data, and has some built-in MRTG-like graphs.  All-in-all, it's a great
  tool for traffic analysis.
 
  Joe
 
  |
  | --
  | Spades

Just a word, probably save you from getting flamed by a someone hard
core down the road...you really should bottom post, as is lets newcomers
to the thread get a glimpse as to what is going on.  This also gets you
the best help.

That said, you can simply change to the /usr/src/ports/net/ntop
directory issue make install clean and sit back.  You will need to read
the documentation on configuring it after it's installed.

Aaron


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


MRTG monitoring specific ports

2004-10-27 Thread Spades
Hi,
Is there anyway for us to trace the server bandwidth based on
specific ports on a MRTG graph?
Such as smtp bandwidth? port 25
pop3 bandwidth? port 110
web bandwidth? port 80
dns bandwidth? port 53
Is there any program or can MRTG do, please advise, thanks.
--
Spades
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: MRTG monitoring specific ports

2004-10-27 Thread Joe Marcus Clarke
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Spades wrote:
| Hi,
|
| Is there anyway for us to trace the server bandwidth based on
| specific ports on a MRTG graph?
|
| Such as smtp bandwidth? port 25
| pop3 bandwidth? port 110
| web bandwidth? port 80
| dns bandwidth? port 53
|
| Is there any program or can MRTG do, please advise, thanks.
I use net/ntop of this.  Ntop can also output Netflow data or RRDTool
data, and has some built-in MRTG-like graphs.  All-in-all, it's a great
tool for traffic analysis.
Joe
|
| --
| Spades
|
| ___
| [EMAIL PROTECTED] mailing list
| http://lists.freebsd.org/mailman/listinfo/freebsd-questions
| To unsubscribe, send any mail to
| [EMAIL PROTECTED]
|
- --
PGP Key : http://www.marcuscom.com/pgp.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBf+d3b2iPiv4Uz4cRAlCgAJ97OPJrVR3j3y9RzPjOuEHgOY3nlwCfUJRL
uItqATmFzZdpeWmoWS33oKA=
=iv3w
-END PGP SIGNATURE-
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: MRTG monitoring specific ports

2004-10-27 Thread Spades
Thanks, how do i install this and view the MRTG of
the port 25, 110, etc.
- Original Message - 
From: Joe Marcus Clarke [EMAIL PROTECTED]
To: Spades [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, October 28, 2004 2:22 AM
Subject: Re: MRTG monitoring specific ports


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Spades wrote:
| Hi,
|
| Is there anyway for us to trace the server bandwidth based on
| specific ports on a MRTG graph?
|
| Such as smtp bandwidth? port 25
| pop3 bandwidth? port 110
| web bandwidth? port 80
| dns bandwidth? port 53
|
| Is there any program or can MRTG do, please advise, thanks.
I use net/ntop of this.  Ntop can also output Netflow data or RRDTool
data, and has some built-in MRTG-like graphs.  All-in-all, it's a great
tool for traffic analysis.
Joe
|
| --
| Spades
|
| ___
| [EMAIL PROTECTED] mailing list
| http://lists.freebsd.org/mailman/listinfo/freebsd-questions
| To unsubscribe, send any mail to
| [EMAIL PROTECTED]
|
- --
PGP Key : http://www.marcuscom.com/pgp.asc
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBf+d3b2iPiv4Uz4cRAlCgAJ97OPJrVR3j3y9RzPjOuEHgOY3nlwCfUJRL
uItqATmFzZdpeWmoWS33oKA=
=iv3w
-END PGP SIGNATURE-
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to 
[EMAIL PROTECTED] 
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]