|
Packit |
667938 |
'*******************************************************************************
|
|
Packit |
667938 |
'* *
|
|
Packit |
667938 |
'* TTraffic 1.0.0 (distributed under GNU GENERAL PUBLIC LICENSE) *
|
|
Packit |
667938 |
'* by kamborio *
|
|
Packit |
667938 |
'* *
|
|
Packit |
667938 |
'* ------------------------------------------------------ *
|
|
Packit |
667938 |
'* _ _ _ *
|
|
Packit |
667938 |
'* | | __ __ _ _ __ ___ | |__ ___ _ __ (_) ___ *
|
|
Packit |
667938 |
'* | |/ / / _` || '_ ` _ \ | '_ \ / _ \ | '__|| | / _ \ *
|
|
Packit |
667938 |
'* | < | (_| || | | | | || |_) || (_) || | | || (_) | *
|
|
Packit |
667938 |
'* |_|\_\ \__,_||_| |_| |_||_.__/ \___/ |_| |_| \___/ *
|
|
Packit |
667938 |
'* ------------------------------------------------------ *
|
|
Packit |
667938 |
'* http://www.kamborio.com/ *
|
|
Packit |
667938 |
'* *
|
|
Packit |
667938 |
'* Copyright (C) 2001 David A. PĂ©rez (david@kamborio.com) *
|
|
Packit |
667938 |
'* *
|
|
Packit |
667938 |
'* This program is free software; you can redistribute it and/or modify it *
|
|
Packit |
667938 |
'* under the terms of the GNU General Public License as published by the Free *
|
|
Packit |
667938 |
'* Software Foundation; either version 2 of the License, or (at your option) *
|
|
Packit |
667938 |
'* any later version. *
|
|
Packit |
667938 |
'* *
|
|
Packit |
667938 |
'* This program is distributed in the hope that it will be useful, but WITHOUT *
|
|
Packit |
667938 |
'* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
|
|
Packit |
667938 |
'* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
|
|
Packit |
667938 |
'* more details. *
|
|
Packit |
667938 |
'* *
|
|
Packit |
667938 |
'* You should have received a copy of the GNU General Public License along *
|
|
Packit |
667938 |
'* with this program; if not, write to the: *
|
|
Packit |
667938 |
'* *
|
|
Packit |
667938 |
'* Free Software Foundation, Inc. *
|
|
Packit |
667938 |
'* 59 Temple Place - Suite 330 *
|
|
Packit |
667938 |
'* Boston, MA 02111-1307, USA *
|
|
Packit |
667938 |
'* *
|
|
Packit |
667938 |
'*******************************************************************************
|
|
Packit |
667938 |
|
|
Packit |
667938 |
TTrafic is a small VBScript to analyse MRTG (http://www.mrtg.org/) log files. By
|
|
Packit |
667938 |
using this script, you will be able to know which amount of traffic is going
|
|
Packit |
667938 |
through your interfaces.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
INSTALLATION
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Copy the file TTrafic.asp to the directory where MRTG is generating the HTML
|
|
Packit |
667938 |
pages.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
The files generated by MRTG have the extension HTML by default. You have to edit
|
|
Packit |
667938 |
your MRTG config file and modify it to make MRTG generate the HTML pages with
|
|
Packit |
667938 |
the extension ASP.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
You should add or edit this line to your config file:
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Extension[_]: asp
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Now, you only need to include the file on the generated pages. The best way to do
|
|
Packit |
667938 |
this, is by editing the MRTG config file and adding this line,
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
to the PageTop option.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
For example:
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Target[core.router.4]: 4:public@core.router
|
|
Packit |
667938 |
MaxBytes[core.router.4]: 1310720
|
|
Packit |
667938 |
Title[core.router.4]: core.router: Ethernet0
|
|
Packit |
667938 |
PageTop[core.router.4]: Traffic Analysis for core.router: Ethernet0
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
System:core.router in the office
|
|
Packit |
667938 |
Maintainer:Myself
|
|
Packit |
667938 |
Interface:Ethernet0 (4)
|
|
Packit |
667938 |
IP: (10.0.0.1)
|
|
Packit |
667938 |
Max Speed:2.0 MBits/s
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
QUERYS
|
|
Packit |
667938 |
|
|
Packit |
667938 |
If the generated page is "core.router.4.asp", you can try to query the page like
|
|
Packit |
667938 |
this:
|
|
Packit |
667938 |
|
|
Packit |
667938 |
http://server/MRTG/core.router.4.asp?Period=365&Order=M
|
|
Packit |
667938 |
|
|
Packit |
667938 |
This will give you the traffic information for the last 365 days. You can enter
|
|
Packit |
667938 |
any value here. The default is 30 days.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Order can be any of these values: K, M, G, T or P.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
K stands for kbytes, M for Megabytes, G for Gigabytes, T for Terabytes and P for
|
|
Packit |
667938 |
Petabytes. If you enter any other value, you will receive the information in
|
|
Packit |
667938 |
Bytes. The default is Gigabytes.
|