

---- Overview of NRG configuration ----

- NRG's configuration is done in three ways.  Each of these methods
corresponds to creating or altering a type of file with a certain
extension: .conf for config files, .mconf for meta-config files and
.tm for template files.

- The Site.mconf file is where NRG is primarily configured.

- NRG metaconf (.mconf) files (eg Site.mconf) are used to 
automatically add, change and delete .conf files en masse.

- NRG conf (.conf) files contain configuration strings that used to 
directly specify various aspects of NRG RRDs and web pages.  To 
fully archive and graph some data source, there must be four sets 
of .conf strings specified:

    - a section defining the system, it's RRD and it's graph web page
    - a section defining the DSs in the RRD and how their are graphed
    - a section defining the labels for the DSs, their units and the Y axis
    - a section defining the content of the RRD's graph web page

- By default NRG specifies a lot of global .conf configuration
strings.  This drastically reduces the number of .conf strings users
add to archive and graph their data sources.  These .conf 
strings are found in the file NRG.mconf.

- NRG .conf configuration strings can contain perl regular
expressions.  These perl regular expression are used to to construct
.conf strings that apply to a specific set of graphs.

- For convenience (eg keeping .mconf configuration files small)
other NRG metaconf files can put in /usr/local/nrg.  To tell
the NRG about their existance, you must edit the MCONF_FILES variable 
in the NRG operations makefile (usually /usr/local/nrg/Makefile.)

- NRG metaconf files are ran through the m4 pre-processor.  This allows
you to use m4 macros to make .mconf files more readable.

- .conf strings may be put in .conf file(s) in /usr/local/nrg.  To
tell NRG about their existance, you must edit the MCONF_FILES variable 
in the NRG operations makefile (usually /usr/local/nrg/Makefile.)

- NRG template (.tm) files are used to specify (fairly
static) aspects of NRG like the structure of NRG RRDs and the
content of NRG web pages.  These files are usually found in
/usr/local/nrg/templates.  After you make changes to a NRG template,
do "make update".  Note that changes to NRG template files do not
get noticed by "make update", so you may get the "no conf changes
found" message.  This is normal.  Do "make notify" and the changes
to your NRG templates will be made.


---- Automatic NRG Configuration ----

- Edit the example .mconf file:

    cd /usr/local/nrg
    vi Site.mconf
      - set "WebRootDir[*]" to the top level directory of your 
        web server's content
      - change occurences of "SomeSwitch" to the name of some network
        device with a working SNMP agent
      - change "1.2.3.4" to the device's IP address
      - change "public" to the device's SNMP v1 community read string

- Configure the NRG operations makefile (usually /usr/local/nrg/Makefile)
variable.

    cd /usr/local/nrg
    vi Makefile
      - set WEB_PREFIX to your web servers' document root directory
      - set NRG_INDEX_TITLE to the title for your nrg web site

- Tell NRG to auto-discover your network and report about changes:

    cd /usr/local/nrg
    make discover

- If "make discover" was not able to auto-discover your device(s),
then you probably have typo in the .mconf file (eg an incorrect IP
address or SNMP community read string.)  Edit Site.mconf again, correct
your mistake(s), and run "make rediscover" until auto-discovery works.

- If "make discover" correctly auto-discovered your device(s),
then put this configuration into production.  This is done by
running nrg-rrdkeeper, nrg-cgikeeper nrg-runmaker, nrg-tablemaker
and nrg-indexmaker.  Fortunately, the NRG Makefile automates this task:

    make notify

- If you want to graph Apache, BIND, ping or Sendmail data, you 
should install and configure the appropiate services and/or 
daemons now: the file "apachestat", L<bindstat>, L<pingdstat>, L<sendmailstat>

- If you want to create a lot of graphs for some type of data
which doesn't have a autodiscovery script, you can use the
nrg-discover-skel.in to write a new autodiscovery script.  This is
a somewhat complex task--please don't hesitate to send me email
asking for help.  Also, if you send me .conf strings and details
about contacting the remote agent involved, I will probably write
the new autodiscovery script for you.

Now read the file "operation".

---- Manual NRG Configuration ----

- Note that, in general, manually configuring of NRG should
be avoided because NRG does not check the validity of manually
configurations.  So consider using the boiler-plate discover script
(src/nrg-discover-skel) to create a new discover script for your new
data type.

- To manually configure NRG, first create a Site.conf file and add
.conf strings to it.  See the .conf files in /usr/local/nrg/autoconfs
The tell NRG about the new .conf file by doing:

    make update
    make notify

