On the machine to be monitored, data from the process table is sampled by bbd, the Big Brother daemon, using the output from ps. The script first determines the type of machine on which it is running in order to determine the correct parameters it must pass to ps and in order to correctly interpret the output of ps on that machine. It then opens a dbm database tied to a file into which it stores its information. A new database file is opened for each day. Next, the script samples the process table using ps at regular time intervals (sample_time_increment defined by the user on the command line). bbd finally writes the following information from ps to the database file:
User - the name or userid number of the user associated with this process
PID - the numeric ID associated with the process
Time - The year, the month, the date and the hour at which the data were recorded
Command - The name of the command, as entered by the user
Running Time - The cumulative amount of time the process has been running. This is simply sample_time_increment*number_of_samples.
The first four elements of this list are used as the database key, thus maintaining a one-to-one correspondence between a given process and its entry in the database.
bbd takes the following command line options
-d dir specifies in which directory the database should be stored. The default is /tmp
-s sample_time_increment specifies the amount of time (in seconds) bbd waits between taking samples. The default value is 30 seconds.