BigBrother: RRDTool and LARRD (Data Trending)

Posted: December 19, 2011 in Linux Related

How to Setup RRDTool and Larrd on your BigBrother using CentOS

BigBrother-Trend02

Notes: must have the following installed 
pod2man cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel

[root@centos6 ~]# cd /usr/local/
[root@centos6 local]# wget https://dl.dropboxusercontent.com/u/21622770/rrdtool-1.4.5.tar.gz
[root@centos6 local]# tar -zxvf rrdtool-1.4.5.tar.gz
[root@centos6 local]# rm -f rrdtool-1.4.5.tar.gz
[root@centos6 local]# cd rrdtool-1.4.5
[root@centos6 rrdtool-1.4.5]# export PKG_CONFIG_PATH=/usr/lib/pkgconfig/
[root@centos6 rrdtool-1.4.5]# ./configure
[root@centos6 rrdtool-1.4.5]# make
[root@centos6 rrdtool-1.4.5]# make install
[root@centos6 rrdtool-1.4.5]# make site-perl-install
[root@centos6 rrdtool-1.4.5]# cd /usr/local/
[root@centos6 local]# ln -s rrdtool-1.4.5 rrdtool
[root@centos6 local]# wget https://dl.dropboxusercontent.com/u/21622770/larrd-0.43e.tar.gz
[root@centos6 local]# tar -zxvf larrd-0.43e.tar.gz
[root@centos6 local]# rm -f larrd-0.43e.tar.gz
[root@centos6 local]# ln -s larrd-0.43e larrd
[root@centos6 local]# ln -s /home/bbuser/bb19c bb
[root@centos6 local]# ln -s /home/bbuser/bbvar bbvar
[root@centos6 local]# chown -R bbuser:apache larrd-0.43e
[root@centos6 local]# cd larrd
[root@centos6 larrd]# perl install -R –bbhome /home/bbuser/bb –larrdhome /usr/local/larrd –bbcgi /var/www/cgi-bin
[root@centos6 larrd]# cd cgi
[root@centos6 cgi]# mv -f larrd-graphs.cgi /var/www/cgi-bin/
[root@centos6 cgi]# mv -f larrd-grapher.cgi /var/www/cgi-bin/
[root@centos6 cgi]# ln -s /var/www/cgi-bin/larrd-grapher.cgi larrd-grapher.cgi
[root@centos6 cgi]# ln -s /var/www/cgi-bin/larrd-graphs.cgi larrd-graphs.cgi
[root@centos6 cgi]# vi /var/www/cgi-bin/larrd-graphs.cgi

Here are the list of changes you have to made:

line: 1
#!/usr/bin/perl

line:70
open(BBDEF,"<$ENV{'BBHOME'}/etc/bbdef-server.sh") or file_error("$ENV{'BBHOME'}/etc/bbdef-server.sh","$!");

change to
open(BBDEF,"<$ENV{'BBHOME'}/etc/bbdef.sh") or file_error("$ENV{'BBHOME'}/etc/bbdef.sh","$!");


line: 83
open(BBINC,"grep \"^BBSKIN=\" $ENV{'BBHOME'}/etc/bbinc-server.sh |") or file_error("$ENV{'BBHOME'}/etc/bbinc-server.sh","$!");

change to
open(BBINC,"grep \"^BBSKIN=\" $ENV{'BBHOME'}/etc/bbinc.sh |") or file_error("$ENV{'BBHOME'}/etc/bbinc.sh","$!");

[root@centos6 cgi]# vi /var/www/cgi-bin/larrd-grapher.cgi

Here are the list of changes you have to made:
line: 1
#!/usr/bin/perl


line: 89
$date =~ s/:/\\:/g;

change to:
$date =~ s/:/-/g; (for newer versions of rrd)

To Fix the error: “ERROR: Expected some arguments after ‘COMMENT:’”

line 338, 388, 439, 489, and 540

qq{COMMENT:$comment},

change to
qq{COMMENT:\\n},

[root@centos6 cgi]# cd /usr/local/larrd
[root@centos6 larrd]# vi larrd-config.pl

Here are the list of changes you have to made:
on line: 55
@DATALIST=("la","disk","bbnet","vmstat","netstat","procs","users","up","WebApp");

@DATALIST=("la","disk","bbnet","vmstat","netstat","procs","users","up","WebApp","apache","memory");


on line: 64
$ENV{'BBLOGSTATUS'}=DYNAMIC;

change to
$ENV{'BBLOGSTATUS'}=STATIC;

line: 69
$ENV{'LARRDHOSTSVC'}="/usr/local/apache2/htdocs/bb/bin/bb-hostsvc.sh";

change to
$ENV{'LARRDHOSTSVC'}="/var/www/cgi-bin/bb-hostsvc.sh";


-- Optional --

Line 77
# $ENV{'LARRDCOMM'}="STATUS";
$ENV{'LARRDCOMM'}="STATUS";


line: 90 and 92
# Messages that will not prevent larrd from functioning properly 

(noisy)
$ENV{'WARN'} = 0;
# Messages that tell you a little about what larrd is doing (very 

noisy)
$ENV{'DEBUG'} = 0;

Check /usr/local/larrd/tmp permission:
drwxrwxrwx 2 bbuser apache 4096 Feb 6 2008 tmp

[root@centos6 larrd]# mkdir /home/bbuser/bbvar/rrd
[root@centos6 larrd]# chown -R bbuser:apache /home/bbuser/bbvar/
[root@centos6 larrd]# ln -s /usr/local/larrd /home/bbuser/bb19c/ext/larrd
[root@centos6 larrd]# mv apache-larrd.pl 043e.apache-larrd.pl
[root@centos6 larrd]# mv memory-larrd.pl 043e.memory-larrd.pl
[root@centos6 larrd]# cp 043c.apache-larrd.pl apache-larrd.pl
[root@centos6 larrd]# cp 043c.memory-larrd.sh memory-larrd.sh
[root@centos6 larrd]# chown bbuser:apache memory-larrd.sh
[root@centos6 larrd]# chown bbuser:apache apache-larrd.pl

[root@centos6 larrd]# vi apache-larrd.pl

Here are the list of changes you have to made:
Line: 1
#!/usr/bin/perl

line: 18
Uncomment it leave till line 20

line: 59
'your-domain.dom' => {    changed to: 'centos6' => { 

[root@centos6 larrd]# vi /etc/httpd/conf/httpd.conf

line: 228 - Uncomment the entry
ExtendedStatus On

line: 921 to 926 uncomment everything

    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from xxx.xxx.xxx.xxx (changed to your allowed network to access this as it may be security rick if you allowed all.

Switch User bbuser

[bbuser@centos6 ~]$ vi /home/bbuser/bb19c/etc/bb-bbexttab

Add this line at the bottom:
localhost :  : larrd/larrd-html.pl
localhost :  : larrd/larrd.pl
localhost :  : larrd/apache-larrd.sh
localhost :  : larrd/bf-larrd.sh
Advertisements
Comments
  1. Mario Tan says:

    Hi.. saw your 1st graph – “cpu load average” and noticed the “date, time” overlapping on the last line.. I too had the same issue.. any suggestion.. installed version: bb5.1, rrdtool1.48, larrd-043e on RHEL 6.4. X64.

  2. Andrei says:

    You’ve made my day. I owe you beer.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s