June 23rd, 2011, 03:18 PM
Tracking Usage Stats Program
Problem Description: I am assigned to make a program to track application usage for Mac computers on campus at a university. This program will record how many times users use licensed applications such as Microsoft Word, Adobe Photoshop, etc and send the data to another program for recording into a database. The purpose is to figure out how many licenses of such programs the university needs. I am not very familiar with Mac and pretty much confused with how I would access system information like that anyway. If anyone has any ideas on what language to use for this or some certain API's or packages or even topics I could research let me know.
What I know so far : I know that I can get a text recording of the processes currently running from the unix terminal. But I am not very familiar with unix programs and if making a program in unix that runs in the background with a timer and everything is a viable option. Possibly if there is a concrete way to call a shell script from another language that might work.
Preferred Solution : PHP or Java ... I am most familiar with them but I am willing to use another language.
June 23rd, 2011, 03:26 PM
Never had a mac, so not that familiar with them but my understanding is that modern mac's have an environment and tools similar to modern unix systems. If that's the case you could try a couple things.
The easiest thing to do would probably be to have a script that kicks of via cron every few minutes and examines the output of ps aux for the programs in question.
Another method which may give more accurate results would be to see if you can replace the binary's for the programs in questions with a small shell script that does the count then runs the appropriate binary.
Recycle your old CD's, don't just trash them
If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
July 12th, 2011, 01:56 PM
This solution is possible, but the design I am going for is recording whenever an application is started or stopped. Periodically examining the process list is kind of going to go against the design I have so far, but it may have to do. I would like to listen for notifications sent out by Mac whenever applications start or stop, and I could examine those notifications to see who owns the process and it's name. I just don't know if this is possible. If anyone knows about how to do this or has anything useful tips on how to interact with Macs activity monitor then let me know.
Originally Posted by kicken