|
Packit |
667938 |
Monitor v.1.1b
|
|
Packit |
667938 |
~~~~~~~~~~~~~~
|
|
Packit |
667938 |
Hi, welcome to the world of Monitor. This is my first ASP based contribution towards the Internet community at large, but
|
|
Packit |
667938 |
I hope that there will be lots more to come.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Monitor is a system designed by me with the use of MRTG. This application will be of most use to Internet Service Providers
|
|
Packit |
667938 |
who may have a range of clients on Lease Lines running from their backbone. The system uses a database which keeps record
|
|
Packit |
667938 |
of all the customers who have Leased Lines.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
The database holds the following information:
|
|
Packit |
667938 |
LineNumber (Or Circuit Number)
|
|
Packit |
667938 |
LinePassword (A Password Protecting The Circuit On Monitor)
|
|
Packit |
667938 |
EMail_Address (This will be used in a later version)
|
|
Packit |
667938 |
Graph_Day (Enable The Daily Graph)
|
|
Packit |
667938 |
Graph_Week (Enable The Weekly Graph)
|
|
Packit |
667938 |
Graph_Month (Enable The Monthly Graph)
|
|
Packit |
667938 |
Graph_Year (Enable The Yearly Graph)
|
|
Packit |
667938 |
Graph_EMail (This will be used in a later version)
|
|
Packit |
667938 |
|
|
Packit |
667938 |
With this information, Monitor provides an easy way for clients to see and monitor their traffic usage after logging into
|
|
Packit |
667938 |
the monitoring system. The users are then also provided with the option to customise the layout of their monitoring system,
|
|
Packit |
667938 |
allowing them to only see the graphs that they need.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Because this is a ASP application, the system has to be hosted on Windows NT Server, or a Unix based server that supports
|
|
Packit |
667938 |
ASP code. For Unix based servers (or if this application is ported to the PHP3 Lanuage), the database routines will need
|
|
Packit |
667938 |
to be redone. Unix' clones will almost certainly not support the same database methods as NT (This application is designed
|
|
Packit |
667938 |
to work with Microsoft's ADO engine for interest sakes).
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
What's Included:
|
|
Packit |
667938 |
~~~~~~~~~~~~~~~~
|
|
Packit |
667938 |
I've included the following files in the distribution:
|
|
Packit |
667938 |
config.asp - This is the ASP file where clients can customise the output from the Monitoring system.
|
|
Packit |
667938 |
default.asp - This is the ASP file where the authentication process will happen.
|
|
Packit |
667938 |
global.asa - global.asa takes care of the deletation of the graph images when a session is abandoned or
|
|
Packit |
667938 |
expires. We also make sure here that users start on the correct page when entering the
|
|
Packit |
667938 |
web site at any point or file.
|
|
Packit |
667938 |
login.asp - After successfull authentication, this page displays the graphs to the users.
|
|
Packit |
667938 |
monitor.html - A page that you can use to explain the service to your clients.
|
|
Packit |
667938 |
monitor.inc - This file holds reference to the Database connection strings, aswell as Session information.
|
|
Packit |
667938 |
readme.txt - You're reading it.
|
|
Packit |
667938 |
monitor.mdb - The Database provided in Microsoft Access 2000 format. (Please read below for more
|
|
Packit |
667938 |
information.)
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Setup:
|
|
Packit |
667938 |
~~~~~~
|
|
Packit |
667938 |
Firstly, for the setup of this application on a NT based server, you need to install MRTG on Windows, and have this working.
|
|
Packit |
667938 |
If you want for some reason not to run MRTG from Windows NT, then please use Samba file sharing, and MAP THE DRIVE to the
|
|
Packit |
667938 |
Windows NT machine that will host the web pages. NT will need PHYSICAL FILE ACCESS to the files (Read Only Access will be
|
|
Packit |
667938 |
sufficient).
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Next, you can take the database (Monitor.mdb), and place this somewhere on your system. The location of the database does
|
|
Packit |
667938 |
not matter that much, seeing that you need to setup a ODBC DataSource Name (DSN), to point the the database file. If you
|
|
Packit |
667938 |
do not want to use DSN connections, have a look in Monitor.inc and change the DSN entry there to point to the file path
|
|
Packit |
667938 |
(DBQ entry). You will also need to change Monitor.inc to have the correct DSN name in for the DSN you have just created.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Thirdly, you need to setup a bit of file permissions. This is more than likely the trickiest part of the installation.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Because MRTG graphs are updated dynamically, we need to implement a system where the graphs are stored OUTSIDE of the web
|
|
Packit |
667938 |
server. We need the graphs outside the web server, so that people can't just link to the images on the monitoring system
|
|
Packit |
667938 |
with a simple tag in ther html on a local web server. This is accomplished with the use of the built in
|
|
Packit |
667938 |
ASP objects CopyFile and DeleteFile. After a successfull login occured, the ASP code will copy the images (all four -
|
|
Packit |
667938 |
daily, weekly, monthly, and yearly), from a pre determined MRTG "spool" directory. This directory will be a global
|
|
Packit |
667938 |
directory where MRTG saves the images from it's targets. It can either be a share that is mapped to the local server, or a
|
|
Packit |
667938 |
local path on the Windows NT host. You need to explictly give the Iusr_machinename user (or the user under which the IIS
|
|
Packit |
667938 |
process run), READ access on both the directory, aswell as all the files within.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
This will allow the ASP code, to read the binary images from the directory, and copy them to inside the web site. Next,
|
|
Packit |
667938 |
what you need to do permission wise, is assign READ, WRITE, and DELETE permissions on both the file and directory inside the
|
|
Packit |
667938 |
Monitor web site, where the target images will be copied to. In this example package, the images are copied to the
|
|
Packit |
667938 |
images/mrtg/ folder.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Once you have your database setup, and the file permissions set up correctly, the site should work. After login, the
|
|
Packit |
667938 |
application will copy the files from the MRTG spool directory, into it's target directory. The graphs will then be
|
|
Packit |
667938 |
displayed to the user, and will reside on the web server for as long as the session exist. Once the user logs out, or
|
|
Packit |
667938 |
when the session expires, the ASP code will automatically issue the DeleteFiles directive which removes the images that
|
|
Packit |
667938 |
are copied from the MRTG spool directory after the user has logged in. The images are re-copied at every refresh of the
|
|
Packit |
667938 |
page, so this will also ensure that images on the monitor web site will remain up-to-date, for as long as the client is
|
|
Packit |
667938 |
logged into the system.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
The supplied database is in Access 2000 form. From what I've heard, Access 2000 is not compatible with older versions.
|
|
Packit |
667938 |
Should you have troubles using this database, please upgrade to Access 2000. If this is a bit of a harsh thing to ask
|
|
Packit |
667938 |
(which I also presume), I have decided to include an SQL Script for the creation of the database. The script is based on
|
|
Packit |
667938 |
Microsoft SQL Server 6.5, but will give you a pretty good idea on how the database should look inside Access...
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Microsoft SQL 6.5 Database Script:
|
|
Packit |
667938 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
Packit |
667938 |
/****** Object: Table dbo.Monitor_Authenticate Script Date: 00/06/17 07:45:08 ******/
|
|
Packit |
667938 |
CREATE TABLE dbo.Monitor_Authenticate (
|
|
Packit |
667938 |
ID int IDENTITY (1, 1) NOT NULL ,
|
|
Packit |
667938 |
LineNumber numeric(18, 0) NOT NULL ,
|
|
Packit |
667938 |
LinePassword varchar (8) NOT NULL ,
|
|
Packit |
667938 |
LineSpeed numeric(18, 0) NOT NULL ,
|
|
Packit |
667938 |
EMail_Address varchar (50) NOT NULL ,
|
|
Packit |
667938 |
Graph_Day bit NOT NULL ,
|
|
Packit |
667938 |
Graph_Week bit NOT NULL ,
|
|
Packit |
667938 |
Graph_Month bit NOT NULL ,
|
|
Packit |
667938 |
Graph_Year bit NOT NULL ,
|
|
Packit |
667938 |
Graph_EMail bit NOT NULL ,
|
|
Packit |
667938 |
LastVisit datetime NULL ,
|
|
Packit |
667938 |
Comment varchar (255) NULL
|
|
Packit |
667938 |
)
|
|
Packit |
667938 |
GO
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Bugs & Problems:
|
|
Packit |
667938 |
~~~~~~~~~~~~~~~~
|
|
Packit |
667938 |
Yes, there are a few of them inside the code at the date when I released this. Although they are nothing serious, I feel
|
|
Packit |
667938 |
that you should take note of this.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
- Client Authentication: If the web user enteres a Curcuit number and password that do not exist in the database,
|
|
Packit |
667938 |
the Database engine responds with an error. This will be fixed in a next release and
|
|
Packit |
667938 |
is not a serious problem to overcome. Possible solution is to code in a additional
|
|
Packit |
667938 |
if statement to check that the circuit number exist BEFORE the authentication process
|
|
Packit |
667938 |
is initiated.
|
|
Packit |
667938 |
- Client Passwords: The client password is limited in the database to 8 characters. A JavaScript or something
|
|
Packit |
667938 |
similar should be implemented in the config page which will limit the passwords entered to
|
|
Packit |
667938 |
8 characters to reflect the limitation in the database. As it is now, the entire password
|
|
Packit |
667938 |
is accepected, although only the first 8 are saved.
|
|
Packit |
667938 |
- Date Formating: The 'LastVisit' date that is displayed on the pages needs to be re-formatted so that it is
|
|
Packit |
667938 |
more readable. This change will more than likely be so that the dates will read:
|
|
Packit |
667938 |
Mon, 19 June 2000, 20:13:11
|
|
Packit |
667938 |
|
|
Packit |
667938 |
If there is anything else that is 'misbehaving' or that you believe can pose to be a problem, please do not hesitate to
|
|
Packit |
667938 |
contact me where I will look into the matter, aswell as issue a update to the code should it be neccessary.
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
|
|
Packit |
667938 |
Contacting me:
|
|
Packit |
667938 |
~~~~~~~~~~~~~~
|
|
Packit |
667938 |
Please feel free to contact me at any time by sending mail to cgknipe@mweb.co.za, I'm always looking forward to hearing
|
|
Packit |
667938 |
from people who uses my code and appreciates the value of implementations done by me.
|
|
Packit |
667938 |
|