You are here

Logging Usage in the BCRC

Since I arrived at UMass, we haven't had a good mechanism to keep track of who's using the BCRC. There was a practice of having people sign-in on paper sheets, which we continued on inertia, but it was never very satisfactory. People just scribbled whatever. Sometimes sheets weren't available. The sheets got lost. And, in the end, it was not a very useful form for data. At the end of the year, I would sample the data and do an analysis to estimate usage in the BCRC.

I had pushed for years (practically since I arrived) to have student accounts that we could use to have students log into the workstations. But with the technical staff stretched as thin as they are, I could never get the issue high enough on the list of priorities to make it happen. When we began working in the ISB, I finally prevailed on George to let me just build the infrastructure we needed. We did pilot-testing last spring and this spring, we're actually doing the deployment. There's still a lot of work to be done, but finally, we're building accounts in a form that we can use them to have students log into our workstations. The generic login is still available, but soon everyone will be required to use a real account to login.

What we still didn't have was a mechanism to record the login data somehow. I had been thinking about the problem for a while and decided that the easiest thing would be to have each computer use curl to talk to a webpage on the server with the information: all we need is the username and the name of the workstation. That gets all the information to the server, but then how to record it. Writing to a flat file wouldn't work because you'd have multiple apache processes all trying to write the file at the same time. Using a database would be stupid because all you need is to write a stupid log file. Then I remembered that PHP offers an api for talking to syslog!

We set up a log local channel in syslog and I wrote a tiny script that just accepts the data and passes it to syslog. Now we have a log file that shows me each time someone logs in. No more sign-in sheets! At the end of the semester, we should be able to develop much more robust data about who's using the BCRC and all of our computer labs.