sub CheckDBStatus($)
{
my $host = $_[0];
my $dbStatus=`ssh $host -C "ps -ef | grep ora_pmon | grep -v grep -c"`;
if ($dbStatus == 1)
{
Log("Database is up on $host",0,LOGFILE);
return("0");
}
else
{
Log("Database is down on $host",0,LOGFILE);
return("1");
}
}
Note: You can use appropriate string to capture Oracle process with grep command.
{
my $host = $_[0];
my $dbStatus=`ssh $host -C "ps -ef | grep ora_pmon | grep -v grep -c"`;
if ($dbStatus == 1)
{
Log("Database is up on $host",0,LOGFILE);
return("0");
}
else
{
Log("Database is down on $host",0,LOGFILE);
return("1");
}
}
Note: You can use appropriate string to capture Oracle process with grep command.
No comments:
Post a Comment