Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

log of computer statistics at university 1

Status
Not open for further replies.

lekaer

Programmer
Jun 12, 2009
6
0
0
NO
Hello everybody.

I dont know if this is the best place to ask, and the moderator is asked to put this wherever he think it belongs.

Im going to make a system which logs the use of the public computers at my university. I want statistics over when each computer is used, and for how long.

The computerlab admin wants access to a (i.e basic html) webpage where he can read statistics about:
-which machines are being used,
-historically how much are the machines used
-how much each computerlab is used (which computerlab who has the most visitors).

This information is used to find out:
-when can we do maintenance on the PCs (in what time during the day are there least visitors)
-do we need more/less computerlabs in certain areas at campus
-are there any computers that is not being used at all and can be
removed
Ive figured out that one way to to it is to make a program which is automatically run at startup as a service/process, and sends information to an external server.

But the best way to do this would be implementing some script/log at the the server which receives a promt for user confirmation. We use AD to logon (and SMS to distribute programs), and to log on to a public PC you have to log on to a domian where your userdata is stored, say
Ive never done anything like this before, so im a total newb at this.
But if anyone is willing to point me in the right direction, i would be truly grateful.

-lek
 
We do a few of these things, although use eDirectory and Zenworks rather than Active directory/SMS.

Some of these things are fairly easy:
Which machines are being used - entry in login script that writes login id, computer name, login date/time to a database running on a server on your network (SQL express or MySQL will be good enough for this, but if you have a decent sql server box with extra capacity feel free to use this).

Over time this will give you details of how much is used over time (you could also analyse the windows event logs on the workstations for logon / logoff events as well).

If your workstation naming convention includes a lab identifier then you can group on this in your reports; if not you will need a table linking computer names to room names. Your reporting for your lab techs can take data from these tables, so it is live.
Be sure when writing your reports to exclude any scheduled classes taking place in those rooms.

--
Regarding maintenance - can I suggest a routine schedule of maintenance that encompasses everything you are likely to need. During that time - and this varies each month - anything from workstation reimaging and patching, server patching and reboots, DNS reconfiguration, switch recabling etc is done.
This is published well in advance to allow people to work around it, including details of who (in terms of buildings, departments, corridors etc, applications / services) will be affected.
Normally ours is 6:00 - 9:00pm on the first Wednesday of the month, but occasionally it is changed (eg if that week has lots of student coursework submission dates).
Depending on what is done, the relevant IT staff work late but get time off in lieu sometime over the next couple of weeks or so - so you don't want everybody involved so people are available the following day - but be sure that those in leave notes over what happened and anything to take account of.

For anything that's too big to do overnight its typically done over a weekend.

Regarding student numbers, if you have an IT helpdesk office, when students come in asking for help, ask them about it - possibly have a general student survey.

John
 
Thank you very much for your reply. Do you know of any guides on how to make such a logfile and write this into DB?
 
Your basic database will have the following tables:

Rooms
RoomID
RoomDescription

Computers
ComputerID
ComputerName
RoomID

Logins
LoginID
LoginTime
ComputerID


Obviously you will need more detailed information. First populate the Computers and Rooms tables, then have a vbscript script run from your login script to write the data in.
Code samples to use VBScript to run ADO database code are at:

I would strongly recommend using a stored procedure to add the row to the table, rather than an "addnew" and populating the fields, or running an insert query; this way the account used to connect to the database server (for logging information) can be very limited.

John
 
Thank you very much. I have now come up with a solution im going to work with this summer. Its a quite simple one, and it does indeed include some of your tips, John.

When a user login, a batch script will write %time%, %date%, %username%, %computername% into a .txt file. The same thing will happen on logout. Then i will create an .exe file who is run at startup, and reads the lines corresponding to the computers last login/logout, and send this information to a mySQL DB.

The only problem i can come up with is that the time and/or date will depend on the time of the induvidual computer, and may not always be intact.
 
If you have an active directory network, ensure the time is correct on your domain controllers then this will filter out to the workstations.
Your network admins will be able to help more.

If they want to go the whole hog, they can time sync the DC's to an atomic clock.

John
 
Another quick thought:

Even with DCs and workstations synced to within a few minutes (a requirement for active directory's kerberos authentication), there is one source of time that is the same for all - that on the database server.
To use this all you need is to have a serverdate field in your Logins table, and populate it with the server date/time (as a default value) pulled from the server's clock.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top