MRTG

From CLONWiki
Revision as of 15:22, 3 January 2007 by Boiarino (talk | contribs)
Jump to navigation Jump to search

MRTG is included in RHEL4; if want to install separately do following:

 create user 'mrtg' with private group 'mrtg'
 mkdir /www/mrtg2.15.0
 chown mrtg.mrtg /www/mrtg2.15.0
 cd /usr/local/src
 chown mrtg.mrtg mrtg-2.15.0
 cd mrtg-2.15.0
 ./configure --prefix=/www/mrtg2.15.0
 make
 make install

Add MRTG-related part to apache config file /www/apache2.2.3/conf/httpd.conf:

 Alias /mrtg "/www/mrtg2.15.0/share"
 <Directory "/www/mrtg2.15.0/share">
   Options Indexes FollowSymLinks
   AllowOverride None
   Order allow,deny
   Allow from all
 </Directory>


Correct contrib/mrtg-startup-script/mrtg and copy it to /etc/init.d/:

 # config:       /www/mrtg2.15.0/etc/mrtg.cfg
 MRTG="/www/mrtg2.15.0/bin/mrtg"
 CONFIG="/www/mrtg2.15.0/etc/mrtg.cfg"


NOTE: temporary fix in:

 ERROR: CFG Error in "Interval": should be at least 5 Minutes (unless you use rrdtool)
 at /misc/clonweb/mrtg2.15.0/bin/../lib/mrtg2/MRTG_lib.pm line 772.


cd /www/mrtg2.15.0 mkdir etc

  1. example
  2. cfgmaker --global 'WorkDir: /home/httpd/mrtg' \
  3. --global 'Options[_]: bits,growright' \
  4. --output /home/mrtg/cfg/mrtg.cfg \
  5. community@router.abc.xyz

DOEN NOT WORK YET ... /www/mrtg2.15.0/bin/cfgmaker --global 'WorkDir: /www/mrtg2.15.0/etc' \

        --global 'Options[_]: bits,growright' \
        --output /www/mrtg2.15.0/etc/mrtg.cfg \
        mrtg@clonweb.jlab.org

DOEN NOT WORK YET ...


  1. copy old stuff from clasweb-bck:

cd /www/mrtg2.15.0/etc scp clasweb-bck:/etc/mrtg/"*" .

  1. create 'web' directories

cd /www/mrtg2.15.0/share mkdir htmls mkdir images mkdir logs


  1. web stuff from clasweb-bck:
  2. scp clasweb-bck:/var/www/html/mrtg.html .
  3. scp clasweb-bck:/var/www/html/mrtg.tar .
  4. tar xvf mrtg.tar
  1. add following to apache config file (/apps/apache2.2.3/conf/httpd.conf):

Alias /mrtg "/www/mrtg2.15.0/share" <Directory "/www/mrtg2.15.0/share">

   Options Indexes FollowSymLinks
   AllowOverride None
   Order allow,deny
   Allow from all

</Directory>

  1. adjust it if necessary
  1. create desired index.html in /www/mrtg2.15.0/share, it will be used
  2. by browser if 'http://clonweb/mrtg/' typed
  1. copy old stuff from previous htlms/*, images/* and lods/*,
  2. if 'mrtg' was running before; it will preserve history;
  3. 'logs' contains recent history, while *.png contains
  4. longer history; start 'mrtg' right the way:

env LANG=C /www/mrtg2.15.0/bin/mrtg /www/mrtg2.15.0/etc/mrtg.cfg