HEX
Server: Apache/2.4.34 (Red Hat) OpenSSL/1.0.2k-fips
System: Linux WORDPRESS 3.10.0-1160.118.1.el7.x86_64 #1 SMP Thu Apr 4 03:33:23 EDT 2024 x86_64
User: digital (1020)
PHP: 7.2.24
Disabled: NONE
Upload Files
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;