BigBrother: How to Install BigBrother Monitoring on CentOS

Posted: December 9, 2011 in Linux Related
Tags: , , ,

How to install BigBrother Monitoring on CentOS

This part of the tutorial only covers the installation of BigBrother Display Server. Client installation are not yet included, those topics are hopefully be included in my future post.

BigBrother

Before proceeding into the installation, please have the following installed on your machine:

  • httpd
  • gcc
  • SELinux should be disabled (if you are not familiar with SELinux)

Create a user for BigBrother called it as “bbuser” and set a password for that user.

[root@centos6 ~]# useradd bbuser
[root@centos6 ~]# passwd bbuser
Changing password for user bbuser.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

Download and prepare BigBrother application. (Switch User to “bbuser”)

[root@centos6 ~]# su – bbuser
[bbuser@centos6 ~]$ wget http://bb4.org/dnld/bb-1.9c.tar.gz
[bbuser@centos6 ~]$ tar -zxvf bb-1.9c.tar.gz
[bbuser@centos6 ~]$ tar xvf bb19c.tar
[bbuser@centos6 ~]$ ln -s /home/bbuser/bb19c /home/bbuser/bb

Installation and configuration procedure: (Switch user to root)

[bbuser@centos6 ~]$ su – root
[bbuser@centos6 install]$ su – root
Password:

[root@centos6 ~]# ln -s /home/bbuser/bb19c/www /var/www/html (create a shortcut link from your BigBrother web toward Apache web)
[root@centos6 ~]# chgrp -R apache /home/bbuser/bb19c/www/rep (cgi-bin scripts could have access over $BBHome/www/rep directory)
[root@centos6 ~]# cd /home/bbuser/bb/install
[root@centos6 install]# ./bbconfig redhat

Do you agree to the terms of this license (y/n): y
Prevent the execution of BB as user ‘root’ (y/n) [y]: y
What will be the user ID of BB [bb]: bbuser
Old-style directory structure (y/n): [n]
Use FQDN (y/n): [y] n (if you have a Fully qualified domain name then select “y”)
What machine will be the BBDISPLAY [centos6]:
What machine will be the BBPAGER [centos6]:
Is this host a BBDISPLAY host (y/n): [y]
Is this host a BBPAGER host (y/n): [y]
Enter the default recipient: [root@localhost] youremail@yourdomain.com
Enter CGI directory [/home/www/httpd/cgi-bin]: /var/www/cgi-bin
Enter the base URL of the CGI scripts [/cgi-bin]:

Enter web server user id [nobody]: bbuser
Enter group name [bbuser]: bbuser

Before we proceed with the installation, lets have a quick fix on some errors you may encounter during and after installation

for error under msgs monitoring:

/var/log/messages is unreadable

[root@centos6 install]# chmod 604 /var/log/messages

for error under disk monitoring:

Filesystem of /home/bb/bbc4.40-bbpe/tmp is FULL

fix the output of df command:

[root@centos6 install]# cd /home/bbuser/bb19c/etc/
[root@centos6 install]# vi bbsys.local

Change
DF=”/bin/df –k” to DF=”/bin/df –hP

fix the script for bb-disk.sh

[root@centos6 install]# exit (Switch back to “bbuser” – you can exit or use su – bbuser command)[bbuser@centos6 install]$ vi /home/bbuser/bb19c/bin/bb-disk.sh

On line 62:
eval “$DFCMD | $EGREP \”$DFUSE\” | $EGREP -v \”$DFEXCLUDE\” | $SORT +{$DFSORT} > $BBTMP/DFOUT.$$”
change to:
eval “$DFCMD | $EGREP \”$DFUSE\” | $EGREP -v \”$DFEXCLUDE\” | $SORT \”-k${DFSORT}\” > $BBTMP/DFOUT.$$”

On line 77
wclen1=`eval “$DFCMD | $EGREP \”$DFUSE\” | $EGREP -v \”$DFEXCLUDE\” | $SORT +{$DFSORT} | $WC”`
change to:
wclen1=`eval “$DFCMD | $EGREP \”$DFUSE\” | $EGREP -v \”$DFEXCLUDE\” | $SORT \”-k${DFSORT}\” | $WC”`

For error during make process:

bbd.c: In function ‘main’: bbd.c:720: error: invalid storage class for function ‘bbd_timeout’ make: *** [bbd.o] Error 1

[bbuser@centos6 install]$ cd ../src (/home/bbuser/bb/src)
[bbuser@centos6 src]$ vi bbd.c

go to line 724
then changed “static void bbd_timeout()” to “void bbd_timeout()” (located on line 722)

Now when all things are fix we are now ready to compile BigBrother

Optional: if you want to put a maintenance page add -DENABLE_DISABLE, if you want to use vmstat on data trending add -DDATAMSG on your BigBrother

[root@centos6 ~]$ vi /home/bbuser/bb19c/src/Makefile (As a root edit Makefile)

On line: 38
CFLAGS=-O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH

add this entry in the end of the line
CFLAGS=-O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG

[bbuser@centos6 src]$ make

Output should look like this:
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG   -c -o bb.o bb.c
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG   -c -o bbsend.o bbsend.c
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG   -c -o utils.o utils.c
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG -o bb bb.o bbsend.o utils.o
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG   -c -o dohostsvc.o dohostsvc.c
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG   -c -o bbd.o bbd.c
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG   -c -o bbpage.o bbpage.c
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG -o bbd bbd.o dohostsvc.o bbpage.o bbsend.o utils.o
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG   -c -o bbnet.o bbnet.c
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG -o bbnet bbnet.o utils.o
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG   -c -o touchtime.o touchtime.c
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG -o touchtime touchtime.o
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG   -c -o dumphostsvc.o dumphostsvc.c
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG -o dumphostsvc dumphostsvc.o dohostsvc.o utils.o
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG   -c -o getipaddr.o getipaddr.c
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG -o getipaddr getipaddr.o utils.o
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG   -c -o bbstat.o bbstat.c
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG -o bbstat bbstat.o
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG   -c -o bbrun.o bbrun.c
cc -O -DREDHAT -DGETTIMEOFDAY -DSIGSETJMP -DREGEXEC -DTIMEH -DENABLE_DISABLE -DDATAMSG -o bbrun bbrun.o utils.o

[bbuser@centos6 src]$ make install

rm -f *.o
mv bb bbd bbnet touchtime dumphostsvc getipaddr bbstat bbrun ../bin

After the installation has been completed, you to setup the server to act as BigBrother display server.

[bbuser@centos6 ~]$ cp /home/bbuser/bb19c/etc/bb-hosts /home/bbuser/bb19c/etc/bb-hosts.org
[bbuser@centos6 ~]$ vi /home/bbuser/bb19c/etc/bb-hosts

xxx.xxx.xxx.xxx centos6 # BBPAGER BBNET BBDISPLAY http://xxx.xxx.xxx.xxx/bb/
[—-IP—-] [hostname] [—— function——] [to be monitored]

How to start and stop BigBrother Monitoring

[bbuser@centos6 ~]$ cd /home/bbuser/bb/ (where runbb.sh script is located)

To start BigBrother Monitoring:

[bbuser@centos6 bb]$ ./runbb.sh start
Starting the Big Brother System & Network monitor
Starting Big Brother Daemon (bbd)...
Starting Network tests (bb-network)...
Starting Display process (bb-display)...
Starting Local tests (bb-local)...
Big Brother 1.9c started

To stop BigBrother Monitoring:

[bbuser@centos6 bb]$ ./runbb.sh stop
Stopping Big Brother...

Check your display server in your Browser: http:xxx.xxx.xxx.xxx/bb/

Note: This tutorial has been tested on CentOS 5.x and CentOS 6.1

Advertisements

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