Monday, 13 October 2014

How to take backup of application in websphere application server through command line?

go to particular DMGR/Node profile/bin and run below command:

./backupconfig.sh -nostop


When we are taking a backup either from <WAS-Root>\bin or <Profile-Root>\bin or from Admin Console, should the Applications be stopped? or is it ok to take a backup even if the application is running?

you can take the backup without stopping the application using -nostop command.

Hi there are three types of backup possible. 

1. Application backup -- Can be taken from console using export backup. 

2. Profile backup -- Can be taken using backupconfig script. 

3. Entire binary backup - This is needed during fixpack update or any major upgradatiuon, please stop all JVMs and tar the entire folder of WAS installation including profiles.

Scripts for monitor websphere IHS instance?

Create a script called log_monitor.sh:

#!/usr/bin/perl -w

use strict;

my $cachefile="/var/cache/lastpos-apache2-scan4maxclntOrSigKill";
my $logfile="/var/log/httpd/error_log";
my $searchstr=" 500 ";

my $lastpos=0;
if (-f $cachefile) {
open FH,"<".$cachefile;
$lastpos=<FH>;
close FH;
};

my $newpos=(stat $logfile)[7];

open FH,"<".$logfile;
seek FH,$lastpos,0;
while (<FH>) {
print if m/$searchstr/i;
};
close FH;

open FH,">".$cachefile;
print FH $newpos;
close FH;

modify $searchstr as needed. note the spaces around "500", since you don't want to match errors which contain a 404 on a file that has "500" in its path or filename (among other places).

configure the script to run every X minutes via cron. the greater the value of X, the less emails you will get (only 1 email every X minutes for all the errors that match the strings you supply). the results of the cron job will get emailed to you automatically (if cron is setup properly)

else
Second way
Use monitoring, try OpenNMS or Nagios which are opensource