Ant303 Posted November 25, 2024 Posted November 25, 2024 hi, apologies if this is the wrong thread, but wasn't sure where to put it. i need to analyse computer usage across my school - how many times a machine is logged into/number of minutes a machine is used for etc. i could import log in log off events into excel and start grinding the figures, but wondered if anyone knew of a more efficient/automated method please? i've seen some products like DeskTrack, ACtivTrak etc, but these are prohibitively expensive! any ideas or products that could be shared would be appreciated. Thanks Anton
mavhc Posted November 25, 2024 Posted November 25, 2024 If you set them to sleep then the time they're on is basically how long they're used for. You can audit power on/off events and forward them to a central event log, then parse that. Or put a script for login/logoff https://www.edugeek.net/forums/wireless-networks/4986-user-logging-utilities-any-free-cheap-ones-recommend.html#post50751 Or run something that pings all the machines and logs when they're online
Ant303 Posted November 25, 2024 Author Posted November 25, 2024 hi, thanks for your reply. i already have the log on and off scripts for users and computers, but the data is huge, excel spreadsheet with almost 250000 rows. i'm hoping there's a program/utility that can capture the data from those logs and easily manipulate it, without taking 3+ hours of processing, as excel has done for me!! cheers though.
mavhc Posted November 25, 2024 Posted November 25, 2024 what format is the data currently in? Are you storing it forever so it'll get larger and larger over time?
Davit2005 Posted November 25, 2024 Posted November 25, 2024 (edited) Syslog would be the obvious choice somehow, what filtering do you use? Any chance it can spit out logs to a syslog server? etc? At a previous org we had a logon script that logged the users logging into to PC/Laptops and put in a central location text file. You could create a folder per PC/Laptop or a folder per day with each PC name. This was over 12 years ago so I can't remember the exact mechanics of how it worked. Then import that data into excel to get the usage however you want to display. Edited November 25, 2024 by Davit2005
Sephiroth Posted November 25, 2024 Posted November 25, 2024 I deal with this by logging to a database with powershell logon/logoff scripts. The database can then be either parsed by powershell (or other scripting language of choice), exported to excel or read by a custom interface (I am in the process of rewriting the one I had to improve functionality).
Ant303 Posted November 25, 2024 Author Posted November 25, 2024 the script gives text files Computer, , Was logged into by, , at,03/09/2024 14:52:11 Computer, , Was logged out of by, , at,03/09/2024 14:52:48 i then import into excel, use formulas to calculate columns with login/off time durations. i archive the source folder each year to keep them in check! current file count for our PCs is 2158!! hence the massive excel files. i just want a 'product' to do all this for me and spit out a report as grinding through excel data isn't quite what i want to spend my time doing - or have any expertise in! 1
Ant303 Posted November 25, 2024 Author Posted November 25, 2024 I deal with this by logging to a database with powershell logon/logoff scripts. The database can then be either parsed by powershell (or other scripting language of choice), exported to excel or read by a custom interface (I am in the process of rewriting the one I had to improve functionality). ah, that sounds like something i'm trying to do, but don't have the expertise (looking at buying it in). surely there's a market for an off the shelf product here!!??
Sephiroth Posted November 25, 2024 Posted November 25, 2024 the script gives text files Computer, , Was logged into by, , at,03/09/2024 14:52:11 Computer, , Was logged out of by, , at,03/09/2024 14:52:48 ... grinding through excel data isn't quite what i want to spend my time doing This is exactly why I do it through a SQL database. let custom code churn out datasets for me in the format that I need, without having to spend anything on a 3rd party product.
Ant303 Posted November 25, 2024 Author Posted November 25, 2024 Syslog would be the obvious choice somehow, what filtering do you use? Any chance it can spit out logs to a syslog server? etc? At a previous org we had a logon script that logged the users logging into to PC/Laptops and put in a central location text file. You could create a folder per PC/Laptop or a folder per day with each PC name. This was over 12 years ago so I can't remember the exact mechanics of how it worked. Then import that data into excel to get the usage however you want to display. logon script is the current method, but is really time consuming and clunky, so looking for other ideas, thanks for your reply though.
Sephiroth Posted November 25, 2024 Posted November 25, 2024 surely there's a market for an off the shelf product here!!?? Quite possibly, but what I have is heavily reliant on our use cases. As I said, I'm in the process of improving the UI and simplifying the dataset whilst cutting down on the processing that each computer does. I started with a very complex method, involving a script that continues to run, allowing for accurate usage of offline devices like laptops, and am trimming it down to what is necessary. I can share the basic form of the code to connect to and log to a database if that's helpful?
LeMarchand Posted November 25, 2024 Posted November 25, 2024 the script gives text files Computer, , Was logged into by, , at,03/09/2024 14:52:11 Computer, , Was logged out of by, , at,03/09/2024 14:52:48 i then import into excel, use formulas to calculate columns with login/off time durations. i archive the source folder each year to keep them in check! current file count for our PCs is 2158!! hence the massive excel files. i just want a 'product' to do all this for me and spit out a report as grinding through excel data isn't quite what i want to spend my time doing - or have any expertise in! You can save a step by having your log on/off scripts create a csv. set mytime=%TIME:~0,-3% echo LogOn,%COMPUTERNAME%,%USERNAME%,%DATE%,%mytime% >> \\Path\To\Logging\UsageLog.csv
mavhc Posted November 25, 2024 Posted November 25, 2024 import pathlib, csv from datetime import datetime # date format used is day/month/year hours:minutes:seconds date_format = '%d/%m/%Y %H:%M:%S' def parseline(row): # login is True or False (logout) login = (row[2] == ' Was logged into by') computer = row[1] user = row[3] time = datetime.strptime(row[5],date_format) print(login,computer,user,time) # if login then store computer/user time of login, if logout then match to login and take difference, then delete login if login: login_store[(computer, user)] = time print(login_store) else: login_time = login_store[(computer, user)] total_time = time - login_time print(total_time) del login_store[(computer, user)] if computer in computer_usage: computer_usage[computer] += total_time else: computer_usage[computer] = total_time if user in user_usage: user_usage[user] += total_time else: user_usage[user] = total_time # Read all csv files # find csv files in current dir files = [f for f in pathlib.Path().glob("./*.csv")] print (files) # init output directories computer_usage = {} user_usage = {} login_store = {} for file in files: with open(file, "r") as csvfile: f = csv.reader(csvfile) for row in f: parseline(row) print(computer_usage) print(user_usage) print(login_store)
BKGarry Posted November 25, 2024 Posted November 25, 2024 Just to pipe in with a suggestion, you have the data in Excel, try using PowerBI desktop to pull in the data and visualise it.
jthompson Posted November 25, 2024 Posted November 25, 2024 This is something that's been on my project ideas list for a while. We also collect timestamps into text files from each logon and logoff, but don't have any reporting layer over it. I've often wondered whether RRDtool could be of use (it would be a good excuse to learn the basics of it!) but I think that assumes datapoints coming it at regular time intervals, which for 100s computers is going to be quite burdonsome. There's also the issue of multiple concurrent user sessions: someone who has left themselves signed in might muddy your data. If it were me I'd begin by putting together some scriting that totals up the session duration for each computer each day from the log files, and add those to the computers' running totals for the current week/month/term as held in a spreadsheet (current week/month rather than the last 7/30 days, since that's simpler without needing a proper database).
gaz350b Posted November 25, 2024 Posted November 25, 2024 hi, apologies if this is the wrong thread, but wasn't sure where to put it. i need to analyse computer usage across my school - how many times a machine is logged into/number of minutes a machine is used for etc. i could import log in log off events into excel and start grinding the figures, but wondered if anyone knew of a more efficient/automated method please? i've seen some products like DeskTrack, ACtivTrak etc, but these are prohibitively expensive! any ideas or products that could be shared would be appreciated. Thanks Anton What's the ultimate goal and reason you are trying to work out usage?
chazzy2501 Posted November 25, 2024 Posted November 25, 2024 used to be an M$ office metrics thingy, that had a speadsheet. urgh or enable auditing, create PS scrips, filter event logs, collect and... way too much.
supportman Posted November 25, 2024 Posted November 25, 2024 Since you already have it in excel format, why not just count the columns by computer name?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now