05 August 2009

Sugar CRM

In order to print defined vars within custom module *viewdefs.php, do the following:

print_r(get_defined_vars())

To get Smarty template vars into Javascript use the {literal} tag to exclude the variable bit from being treat as javascript text file.

{/literal}{$fields.sales_stage.value}{literal}

15 May 2008

Today's Quote

The world is changing very fast. Big will not beat small anymore. It will be the fast beating the slow.
Rupert Murdoch

During the staff meeting today, Bevan quoted the above as the inspiration to all staff. It is so true in everything aspects in the business world. Thinking about software development people expect fast development as well. It is definitely worthwhile to take some time to summarizing skills and technologies to get things done quick. After years of programming I realized that I urgently need to have at least a collection of methods and libraries to implement fast development. Try new approaches and at the same time start building up REAL assets.

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