28 June 2007

RTG-0.7.4 Installation notes

After a few weeks' effort, I finally get the stuff up and running. To summarize, here are the brief steps:
1. Prerequisite: [Net SNMP]; [MySQL] ./configure --enable-thread-safe-client [Perl DBI]
2.Build RTG and install into default location /usr/local/rtg:
$ gzip -d rtg-x.y.tar.gz
$ tar -xvf rtg-x.y.tar
$ cd rtg-x.y/
$ ./configure
$ make
# make install
3.setup the database for RTG:
$ /usr/local/rtg/etc/createdb mysqlrootpassword ***create user snmp, rtg for mysql; create basic db structure
4.generate /usr/local/rtg/etc/routers file using the CreateRTGRouters.class.php that I made. format:"router:community:bits"
5./usr/local/rtg/etc/rtgtargetmkr.pl ***create targets.cfg; create tables for each interface in database rtg
6.$ /usr/local/rtg/bin/rtgpoll -v -t targets.cfg > /usr/local/rtg/log/targets.out *** start polling. I suggest to turn on one level of verbosity and log into a file. It's good to have something to look at if something goes wrong.;-)
7.revise rtg.conf SNMP ver -> 2 if nessecary
8.Adding poller to crontab
#crontab -e
@reboot /usr/local/rtg/bin/rtgpoll -v -t /usr/local/rtg/etc/targets.cfg -c /usr/local/rtg/etc/rtg.conf

a few changes on original createdb script:
======Createdb==================================
line 117:
Replace
/tmp/mysql.sql | $MYSQLBIN/mysql -u root -p $ROOTPASS mysql
with
mysql mysql < /tmp/mysql.sql -u root --password=$ROOTPASS Same replace for line 119 121 123 [tips]: -p $ROOTPASS => --password=$ROOTPASS
mysql DB < *.sql -u root --password=
================================================
------end of installation; start split the tables using merge table--------
1.copy rtg to rtg(pre_month)
mysqldump rtg > /home/yliu/rtg.sql -u root --password=mysqlrootpassword
create database rtg200705(pre month);
use rtg200705; \. /home/yliu/rtg.sql; drop table interface; drop table router;
2.Set rtg storage engine to merge with no Union list
open rtg.sql, replace last bit of the definations of tables with ENGINE=MERGE INSERT_METHOD=LAST;
use rtg; \. /home/yliu/rtg.sql;
3. excute update_merge_tables_rtg.pl
4. add cron line like this 0 0 1 * * /usr/local/rtg/bin/update_merge_tables_rtg.pl