Armadito-Agent
view release on metacpan or search on metacpan
lib/Armadito/Agent/Antivirus/Kaspersky.pm view on Meta::CPAN
package Armadito::Agent::Antivirus::Kaspersky;
use strict;
use warnings;
use base 'Armadito::Agent::Antivirus';
use UNIVERSAL::require;
use English qw(-no_match_vars);
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%params);
$self->{name} = "Kaspersky";
$self->{program_path} = $self->getProgramPath();
$self->{scancli_path} = $self->{program_path} . "\\avp.com";
$self->{version} = $self->getVersion();
return $self;
}
sub getJobj {
my ($self) = @_;
return {
name => $self->{name},
version => $self->{version},
os_info => $self->{os_info},
scancli_path => $self->{scancli_path}
};
}
sub getVersion {
my ($self) = @_;
if ( $self->{program_path} =~ m/Kaspersky Anti-Virus (.*)$/ ) {
return $1;
}
return "unknown";
}
sub getProgramPath {
my ($self) = @_;
my $osclass = $self->getOSClass();
return $osclass->getProgramPath();
}
sub getDataPath {
my ($self) = @_;
my $osclass = $self->getOSClass();
return $osclass->getDataPath();
}
sub getOSClass {
my ($self) = @_;
my $class = "Armadito::Agent::Antivirus::Kaspersky::" . $self->{os_info}->{libpath};
$class->require();
my $osclass = $class->new( logger => $self->{logger}, antivirus => $self );
return $osclass;
}
1;
__END__
=head1 NAME
( run in 1.427 second using v1.01-cache-2.11-cpan-800906f7e73 )