scc - file formats used by SCC
scc 1.6.26
SCC stores configuration data from systems in flat files called snapshots. All configuration data is structured by prefixing it with a fixed-variable indication and with a hierarchical classification. The indication, all elements of the classification and the configuration data are separated by colon's.
By comparing two consecutive snapshots and ignoring the variable data, we are able to maintain a logbook of a system. Lines in the logbook also consist of colon separated fields.
The contents of the file /var/adm/cron/cron.allow are stored in a snapshot in the following way:
fix:software:cron:configuration::/var/adm/cron/cron.allow:root fix:software:cron:configuration::/var/adm/cron/cron.allow:adm fix:software:cron:configuration::/var/adm/cron/cron.allow:uucp
After the indicator "fix" for fixed data, there are at most five levels of hierarchical classifications of the remaining data. The classification and the data are separated by two consecutive colons.
When this file is altered (uucp should not run cron-jobs), the missing line is reported in the logbook. The reported data contains the change itself (uucp) and the classification of the altered data (software:cron:configuration::/var/adm/cron/cron.allow:). Without the classification SCC only could have reported that a user has been removed.
The output of scc-collect is checked by scc-log. Any line that does not start with "fix:" of "var:" is prefixed with "fix:messages::", indicating unexpected output from one of the commands used by scc-collect. As the html-file groups data per classification, the original snapshot has to be inspected to locate the commands causing this output.
The snapshot is converted to a hierarchical menu. Therefore the following combination of classifications cannot be used:
fix:software:myprogram:: fix:software:myprogram:config::
The first classification results in html-code to access "myprogram" as an option in the sub-menu "software". The second classification should result in html-code to access a sub-menu "myprogram" containing the option "config".
It is the responsibility of the developer to ensure a correct menu-structure by using the correct classifications in scc-collect and in the plugins. This kind of errors is detected and reported in the snapshot by scc-collect.
Two consecutive snapshots are compared using diff. The resulting output is altered to indicate the old and the new configuration. When the user uucp is removed from cron.allow, the following data is added to the logbook:
2001-09-12:11.18.46:result::different 2001-09-12:11.18.46:remark:: 2001-09-12:11.18.46:count::1 2001-09-12:11.18.46:previous date::2001-09-08 2001-09-12:11.18.46:previous time::07.37.46 2001-09-12:11.18.46:data::old::software:cron:configuration:: /var/adm/cron/cron.allow:uucp
For clarity the last line has been folded.
Again we see colon separated fields. The first fields indicate the date and time of the change. Then there is a classification of the remaining fields, separated by two, consecutive colons from the differences. The classification is limited to: result, remark, count, previous date, previous time and data.
After reporting the result and some administrivia, finally the actual change is reported. The keyword old indicates that this data was only present in the old snapshot. So it has been removed from the current configuration of the system.
The keep-file is used to store data that is obtained from running processes, that might not be running during the next run of scc. To avoid changes in the logbook any time such a process temporarily does not run, the obtained data is stored in a keep-file. scc-collect uses the data in this file when the processes are not running. Examples of the data in the keep-file are apache-configuration data and rpm-data. The latter data should be recorded in the keep-file as the rpm-database is locked during installs and rpm does not return any data when it is queried during an install.
The format of the keep-file looks like the format of the snapshots. It consists of lines with colon-separated fields. Leading fields are used to identify the data. The contents of the keep-file are determined by scc-collect.
The keep-file is removed during the installation of SCC to enable upgrades of the format of this file. This results in the "feature" that SCC is unable to record it's own upgrade on a RPM-system.
SCC is free software under the terms of the GNU General Public License. Copyright (C) 2001-2004 Open Challenge B.V., 2004-2005 OpenEyeT Professional Services.
scc(1), scc-collect(1), scc-log(1), scc-log2html(1), scc-plugin(1), scc-snap2html(1), scc(4), scc(5)
$Revision: 1.26 $