Generating index for data stored in a CONF file: A new way of System management
ABDULRAUF 270002CXRA Visits (1431)
System management includes the administration of various system services like DHCP, DNS, and FIREWALL. All of these services use standardized configuration files. Manual modification of these files is tedious, so software is used to reduce frustration and increase accuracy. These files vary in format and content according to the system service they are using. Some data might have multiple occurrences. Locating and manipulating data can be difficult in file-using software. The solution is an index value/hash value associated with the configuration file so that the data that we want to manipulate can rely on index values to identify the same data every time. This is similar in concept to DB indexing.
We have a configuration (CONF) file and now we want unique hash/index values associated with the stored data. Similar to a database, we also want the hash values to be persistent. The data in the file need to be partitioned to have the hash values associated with them. Let’s partition the CONF file into FIELDS, where a field could be:
Unique hash values can be generated using any algorithm for random number generation.
Storing and making the hash values persistent is our goal. First, make a duplicate copy of the CONF file. Create another file to store the hash values. The CONF file is logically partitioned as consecutive FIELDS and the hash-key file would store the hash values consecutively, such that the duplicate CONF file's fields would be mapped one-to-one with the hash values in the hash-key file. If delimiters partition the duplicate CONF file's fields, the hash-key file needs the same delimiter for separating the hash values. If the CONF file is modified, either manually or by software, only the original configuration file would be modified. The duplicate copy is to track the changes. A modification in the CONF file could be creation, deletion, or modification of a FIELD. The same change would not be reflected in the duplicate copy and identification of time and type of changes is facilitated. Once the change is identified, the duplicate CONF file would be brought up-to-date to the CONF file, and the hash-key file would be updated accordingly.
This program needs three functions:
The flow chart below illustrates this implementation:
Flowchart :Initialization and track changes
This easy method of associating index values and hash values with CONF files can be an easy solution to a frustrating problem.
About the Author:
ABDUL RAUF EM has 10+ years of industry experience in software development and testing fields, with proven expertise in different skills and with involvement in various life cycles of project development. He has completed MS in telecommunication and software engineering from BITS Pilani -