---
name: "lg.conf"
section: "5"
platform: "linux"
package: "rancid-cgi"
version: "3.14-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/lg.conf"
---

# lg.conf(5)

looking glass configuration file

## NAME

lg.conf - looking glass configuration file

## DESCRIPTION

**lg.conf** contains configuration for the looking glass scripts.

The syntax is that of [*perl*(1)](/perl/1.md). It is used to set variables that affect run-time behavior and/or to locate resources.

## VARIABLES

The following variables are used (alphabetically):

- **LG\_AS\_REG**

  \*\*\* not implemented.

- **LG\_BGP\_RT**

  Allows show ip bgp neighbor commands that can produce heavy output, such as sh ip bgp neighbor \<ip\> advertised-routes for a transit customer when the neighbor address is followed by 'advertised-routes' for the sh ip bgp neighbor query.

- **LG\_CACHE\_DIR**

  Sets the location of the cache directory.  The looking glass uses this to hold lock files, log files, and output from cached commands.

  Default: ./tmp

  Note that the default is relative to the directory where *lg.cgi* runs in the server's document root (e.g.: /usr/local/www/data/lg/tmp).

- **LG\_CACHE\_TIME**

  Sets the number of seconds that the looking glass should cache output from commands that tend to produce a lot of output, such as 'show ip bgp dampened-paths'.

  Default: 600

- **LG\_CLOGINRC**

  Defines the location of the [**cloginrc**(5)](/cloginrc/5.md) that the looking glass should use.  The path may be relative to the directory where the CGI scripts run in the server's document root.

  Default: $HOME/.cloginrc

  Note that the .cloginrc must be readable by the user or group that will be running the CGI and that [**clogin**(1)](/clogin/1.md) will not allow a world readable *.cloginrc*. The user is normally that of the http server (httpd).

- **LG\_IMAGE**

  Defines a html image tag (\<img\>) which, if defined, will be included at the top of the looking glass pages.  It may contain any html as it is simply handed off to print().

  Example: $LG\_IMAGE="\<img src=/icons/rancid.gif hspace=0\>\\n \<font size=+2\>FOO\</font\>";

- **LG\_INFO**

  Defines information in html format which, if defined, will be included at the bottom of the looking glass form page.  It may contain any html as it is simply handed off to print().

  Example: $LG\_INFO="For Support contact \<a href=mailto:webmaster@localhost\>webmaster\</a\>";

- **LG\_LOG**

  Defines the fully qualified path name (i.e.: begins with '/') for the log file or the [**syslog**(3)](/syslog/3.md) facility to use for logging.  For syslog, the argument is the lowercase name of a syslog facility (see syslog.h) without the 'LOG\_' prefix.

  Example: local0

  Default: $LG\_CACHE\_DIR/lg.log

- **LG\_ROUTERDB**

  Sets the location for the *router.db* file in rancid's [**router.db**(5)](/router.db/5.md) format.  It lists the devices that should be available to the looking glass users.  Only those devices of supported types and with state 'up' are made available.  If not defined and the default file does not exist, the looking glass will compile a list from the router.db files of all the groups present in rancid, that is, the list will be a concatenation of the available [*router.db*(5)](/router.db/5.md) files.

  Note that if the concatenation method is used, it may be necessary to alter the mode of the router.db files in the rancid group directories, since rancid's default umask is 027 (see [**rancid.conf**(5)](/rancid.conf/5.md)).

- **LG\_STRIP**

  Causes the LG to strip login information from the looking glass results. Since Expect often munges disabling echo when passwords are entered, this is a SECURITY CONCERN!  However, this output can be very useful for debugging clogin problems.

- **LG\_STYLE**

  Defines the URL of a style sheet to be used for HTML formatting.

- **PATH**

  Is a colon separated list of directory pathnames in the file system where rancid's login scripts, [*clogin*(1)](/clogin/1.md) etc.) and programs needed within these, such as [*telnet*(1)](/telnet/1.md), are located. Its value is set by configure.  Should it be necessary to modify PATH, note that it must include $BASEDIR/bin (see above).

- Queries ...................................

  ## ENVIRONMENT

- **LG\_CONF**

  Location of **lg.conf** file.  See the *FILES* section for more information.

## ERRORS

**lg.conf** is interpreted directly by [*perl*(1)](/perl/1.md), so its syntax follows that of perl.  Syntax errors may produce quite unexpected results.

## FILES

- **/etc/rancid/lg.conf**

  Configuration file described here.

  **lg.conf** is located by the value of the environment variable LG\_CONF, in the CWD (current working directory), or the sysconfdir defined when rancid was installed, in that order.

## SEE ALSO

[**cloginrc**(5)](/cloginrc/5.md), [**lg\_intro**(7)](/lg_intro/7.md), [**router.db**(5)](/router.db/5.md)

## HISTORY

In RANCID releases prior to 2.3, **lg.conf** was located in the util/lg sub-directory of the install path.  This was changed to be more consistent with common file location practices.
