File: //var/opt/OV/bin/instrumentation/OpIntService.pm
###############################
#
# Version : 11.11.025
#
###############################
package OpIntService;
sub new {
my ($class) = shift;
my (%params) = @_;
bless { "SERVICE_NAME" => $params{"SERVICE_NAME"}, }, $class;
}
package OpIntService::Solaris10;
@ISA = (OpIntService);
sub new {
my ($class) = shift;
my (%params) = @_;
my ($self) = OpIntService->new(@_);
$self->{"OS_SPECIFIC_CMD"} = "svcadm enable";
return ( bless( $self, $class ) );
}
sub form_opint_cmd {
$self = shift;
$cmd = $self->{'OS_SPECIFIC_CMD'} . " " . $self->{'SERVICE_NAME'};
return $cmd;
}
package OpIntService::Solaris9;
@ISA = (OpIntService);
sub new {
my ($class) = shift;
my (%params) = @_;
my ($self) = OpIntService->new(@_);
$self->{"OS_SPECIFIC_CMD_VAL1"} = "/etc/init.d/";
$self->{"OS_SPECIFIC_CMD_VAL2"} = "start";
return ( bless( $self, $class ) );
}
sub form_opint_cmd {
$self = shift;
$cmd = $self->{'OS_SPECIFIC_CMD_VAL1'}
. $self->{'SERVICE_NAME'} . " "
. $self->{'OS_SPECIFIC_CMD_VAL2'}; ;
return $cmd;
}
package OpIntService::HPUX;
@ISA = (OpIntService);
sub new {
my ($class) = shift;
my (%params) = @_;
my ($self) = OpIntService->new(@_);
$self->{"OS_SPECIFIC_CMD"} = "start";
return ( bless( $self, $class ) );
}
sub form_opint_cmd {
$self = shift;
$cmd = $self->{'SERVICE_NAME'} . " " . $self->{'OS_SPECIFIC_CMD'};
return $cmd;
}
package OpIntService::LINUX;
@ISA = (OpIntService);
sub new {
my ($class) = shift;
my (%params) = @_;
my ($self) = OpIntService->new(@_);
$self->{"OS_SPECIFIC_CMD_VAL1"} = "service";
$self->{"OS_SPECIFIC_CMD_VAL2"} = "start";
return ( bless( $self, $class ) );
}
sub form_opint_cmd {
$self = shift;
$cmd =
$self->{'OS_SPECIFIC_CMD_VAL1'} . " "
. $self->{'SERVICE_NAME'} . " "
. $self->{'OS_SPECIFIC_CMD_VAL2'};
return $cmd;
}
package OpIntService::AIX;
@ISA = (OpIntService);
sub new {
my ($class) = shift;
my (%params) = @_;
my ($self) = OpIntService->new(@_);
$self->{"OS_SPECIFIC_CMD"} = "startsrc -s";
return ( bless( $self, $class ) );
}
sub form_opint_cmd {
$self = shift;
$cmd = $self->{'OS_SPECIFIC_CMD'} . " " . $self->{'SERVICE_NAME'};
return $cmd;
}
1;