Scripting helps to automate a task. If you are looking for a script to check the status of the OVM then the below perl script can be used to check the status of the Oracle VM manager.
Save the file as check_vm_status.pl
#!/usr/bin/perl -w
my $status = `service ovmm status`;
chomp($status);
my $statusok = "Oracle VM Manager is running...";
if ( $status ne $statusok ) {
print "oracle vm is not running";
}
else
{
print "$status";
}
To run the script,
$ perl check_vm_status.pl
$ perl check_vm_status.pl
The output of the above script is as below, If the OVM is running then,
Oracle VM Manager is running...
If the OVM is not running then
oracle vm is not running
The same code can be used as Korn shell script as below
Save the file as check_vm_status.ksh
#!/usr/bin/ksh -w
$status = `service ovmm status`;
$statusok = "Oracle VM Manager is running...";
if ( $status ne $statusok ) {
print "oracle vm is not running";
}
else
{
print "oracle vm is running";
}
Hope this helps!
Save the file as check_vm_status.ksh
#!/usr/bin/ksh -w
$status = `service ovmm status`;
$statusok = "Oracle VM Manager is running...";
if ( $status ne $statusok ) {
print "oracle vm is not running";
}
else
{
print "oracle vm is running";
}
To run the script,
$ perl check_vm_status.ksh
$ perl check_vm_status.ksh
Hope this helps!