NMR Unix Accounting Scripts

Overview

These Unix accounting scripts and programs were designed to extract the records of interest for tracking NMR usage from the large volume of records saved by the Unix accounting scripts. Most of the work is done by scripts that can be modified fairly readily. There are several C-language compiled programs that are used to do translations or lookups that are difficult or impossible using only scripts (or so it seemed when these programs were written.) There may be easier ways to perform these functions, but this package has been operating here at Texas A&M for several years now, both under SunOs 4.1.3, then under Solaris 2.4 and now under solaris 2.7. They have also ported easily to RedHat Enterprise Linux.

Unix Accounting

The standard, Sun-supplied Unix accounting package must be installed and running before the NMR-specific routines can be added. Broadly speaking, the Unix accounting tracks every login on the system and every process that runs. This is generally much more information than we are interested in for NMR accounting purposes. The Unix account is designed to run a script (runacct) on a daily basis, reducing all of the accounting records to a more manageable size. Once a month a second script (monacct) should be run to generate the Unix monthly report. Under Solaris 2.4, both of these scripts have provision for running additional, local scripts (runacct.local and monacct.local). It is in these scripts that the NMR specific commands are added. The SunOs accounting works much the same, except that there is no specific provision for calling the two local accounting scripts within the Sun Supplied scripts. There are scripts in the distribution package for SunOs that have the requisite calls to the two local scripts.

VnmrX Accounting

We have Sun workstations used both as host computers on spectrometer systems and as stand alone workstations for off-line data processing. We are only charging for spectrometer time, but we are tracking the workstation usage just to know how busy they are. The accounting problem for the two systems is somewhat different, however, and there are two variants of the necessary scripts. One set is used on spectrometers and the other on workstations.

For spectrometer systems, we make the assumption that time spent logged in on the system console is time spent running the spectrometer system, and that the magnet is basically unavailable to other users. This is not as true as it once was, but it is still accurate enough in our situation, and there does not seem to be a better criterion.

For workstations, we track the amount of time that users spent running the VnmrX program. Console usage is not of great interest, but since several users can access VnmrX simultaneously by using X-servers, that seems to be the more interesting statistic. We don't worry, at least so far, how much time is spent with e-mail, archiving data, etc.

The script that runs daily filters out both console logins and records of the usage of the VnmrX program and keeps these records in separate files for the NMR accounting process. The monthly script takes the two cumulative files, one of VnmrX and one of Console usage, sorts them by user, and totals up the amount of time used by each user. All of this information is then reported in a large NMReport file. In addition a second, summary file is prepared with just user names and hours reported. This is the record that is imported into our billing data base. The hours reported are either the Console logins or the VnmrX usage, depending on the system type. Both numbers are reported in the large report file, however.

Downloading

This is a link to download the Unix accounting software package. That package contains a variety of help files and descriptive text files. Right-click on NMR accounting software and save the tar file to you system. This tar file will unpack into an accounting subdirectory. De-tar it, look at the readme file, and install it. If you have problems or questions, send e-mail to gregory.wylie@chem.tamu.edu.