Both of these scripts begin with reading the configuration file. If there is an error in the file’s syntax or if the file can not be found, error messages will be displayed on standard-error. The Apache http server redirects standard-error to its error log file by default.
lgform.cgi displays a html form consisting of a list of possible router commands that can be run and a scrolling list of routers that these commands may be run on. When the form is submitted, lg.cgi is run.
lg.cgi begins by performing some basic checks on the arguments passed to it. If these checks pass, lg.cgi either displays cached data from a previous invocation, if that data exists and is within the cache interval, or uses clogin(1) to login to the device and execute the command. The results of the command are cached if applicable and displayed for the user.
Note that the looking glass scripts require a few perl modules not included with rancid. Rancid’s configure process does not check for these. See the README file.