BigBrother: Add Maintenance page “maint.pl”

Posted: December 13, 2011 in Linux Related

How to add maintenance windows on BigBrother

BigBrother-Maintenance

In order for this to work make sure you have compiled your bbd with -DENABLE_DISABLE under CFLAGS.

Login as BBuser and download maint.pl script fro Quest Community:

[bbuser@centos6 ~]$ wget https://dl.dropboxusercontent.com/u/21622770/maint.pl.v2.11.tar.gz
[bbuser@centos6 ~]$ tar zxvf maint.pl.v2.11.tar.gz

after extracting the main tar file you will have this three files.

  • maint.pl
  • wrench.gif
  • add2header.txt

[bbuser@centos6 ~]$ rm maint.pl.v2.11.tar.gz (Removed the download tar file)
[bbuser@centos6 ~]$ mv /home/bbuser/wrench.gif /home/bbuser/bb19c/www/gifs (move the file from $BBSKIN directory)
[bbuser@centos6 web]$ cat /home/bbuser/add2header.txt

<A HREF="&CGIBINURL/maint.pl"><IMG SRC="&BBSKIN/wrench.gif" ALT="Maint"
TITLE="Maint" WIDTH="39" HEIGHT="27" BORDER=0></A>

Copy and paste the entry above since you will need to insert this line on the following

/home/bbuser/bb19c/web/bb2_header
/home/bbuser/bb19c/web/bb_header
/home/bbuser/bb19c/web/hist_header
/home/bbuser/bb19c/web/histlog_header
/home/bbuser/bb19c/web/hostsvc_header
/home/bbuser/bb19c/web/replog_header

add the line that you have copy from above on line 44:

Entry should look like this in all header file.

<TABLE SUMMARY="Navigation" WIDTH=100%><TR><TD VALIGN=TOP ALIGN=LEFT>
<A HREF="http://bb4.com"><IMG SRC="&BBSKIN/bb.gif" ALT="Get Big Brother"
        WIDTH="120" HEIGHT="24" BORDER=0></A><BR>
<A HREF="&BBWEB/help/bb-ack.html"><IMG SRC="&BBSKIN/bbnav1.gif"
        ALT="Contact" WIDTH="39" HEIGHT="27" BORDER=0></A>
<A HREF="&BBWEB/bb2.html"><IMG SRC="&BBSKIN/bbnav2.gif" ALT="Condensed view"
        WIDTH="39" HEIGHT="27" BORDER=0></A>
<A HREF="&BBWEB/help/bb-rep.html"><IMG SRC="&BBSKIN/bbnav4.gif" ALT="Report"
        WIDTH="39" HEIGHT="27" BORDER=0></A>
<A HREF="&BBWEB/help/bb-help.html"><IMG SRC="&BBSKIN/bbnav3.gif" ALT="Help"
        WIDTH="39" HEIGHT="27" BORDER=0></A>
<A HREF="&CGIBINURL/maint.pl"><IMG SRC="&BBSKIN/wrench.gif" ALT="Maint"
        TITLE="Maint" WIDTH="39" HEIGHT="27" BORDER=0></A>
</TD><TD VALIGN=TOP ALIGN=RIGHT>

[bbuser@centos6 ~]$ rm add2header.txt (when you have finish modifying all of the header file)

Switch to to user root since we need to move “maint.pl” over root ownership directory:

[root@centos6 ~]# mv /home/bbuser/maint.pl /var/www/cgi-bin
[root@centos6 cgi-bin]# chown root:root /var/www/cgi-bin/maint.pl (Change permission)

We need to fix some parts of the script in order for it to work:

[root@centos6 cgi-bin]# vi /var/www/cgi-bin/maint.pl

on line 1
#!/usr/local/bin/perl -wT
changed to:
#!/usr/bin/perl -wT

on line 162
my $BBHOME = “/usr/local/bb/bb“;
changed to:
my $BBHOME = “/home/bbuser/bb“;

on line 165
my $BBVAR = “/usr/local/bb/bbvar“;
changed to:
my $BBVAR = “/home/bbuser/bbvar“;

Start BigBrother

[bbuser@centos6 ~]$ /home/bbuser/bb19c/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

Put the server in maintenance mode using Command line:

go to: /home/bbuser/bb/bin

to disable: 
./bb <site server> "disable <unit>.<module or * for all> <duration (ie, 3d, 1h, 30m)> <comment -name>" to enable: ./bb <site server> "enable <unit>.<module or * for all>"

example:
./bb centos6 "disable centos6.* 1h testing -bbuser"
Advertisements
Comments
  1. Blurry says:

    aww broken link for maint.pl.v2.11.tar.gz

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