anciate module. Set task's default logger.
=head2 getJobj ( $self )
Return unblessed object for json encapsulation.
=head2 getVersion ( $self )
Return Antivirus' Version.
=head2 getProgramPath (
ent;
use strict;
use warnings;
use base 'Armadito::Agent::HTTP::Client::ArmaditoAV::Event';
use JSON;
use Armadito::Agent::Tools::Security qw(isANumber);
sub new {
my ( $class, %params ) = @_;
m
y ( $self, %params ) = @_;
$self->{taskobj}->{jobj}->{task}->{obj} = $self->{jobj};
my $json_text = to_json( $self->{taskobj}->{jobj} );
my $response = $self->{taskobj}->{glpi_client}->sendReques
t(
"url" => $self->{taskobj}->{agent}->{config}->{server}[0] . "/api/scans",
message => $json_text,
method => "POST"
);
if ( $response->is_success() ) {
$self->{taskobj}->{logger}->info(
ent::Task';
use Armadito::Agent::Storage;
use Data::Dumper;
use MIME::Base64;
use Try::Tiny;
use JSON;
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%params);
if ( $param
se ) = @_;
$self->{logger}->info( "Error Response : " . $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
$self->{logger}->error( Dumper($obj) );
return $self;
= @_;
my $json_text = to_json( $self->{jobj} );
my $response = $self->{glpi_client}->sendRequest(
"url" => $self->{agent}->{config}->{server}[0] . "/api/jobs",
message => $json_text,
meth
Armadito::Agent::Task::AVConfig;
use strict;
use warnings;
use base 'Armadito::Agent::Task';
use JSON;
use Data::Dumper;
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%para
se ) = @_;
$self->{logger}->info( "Error Response : " . $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
$self->{logger}->error( Dumper($obj) );
return $self;
$json_text = to_json( $self->{jobj} );
$self->{logger}->debug($json_text);
my $response = $self->{glpi_client}->sendRequest(
"url" => $self->{glpi_url} . "/api/avconfigs",
message => $json_t
e Armadito::Agent::Task::Alerts;
use strict;
use warnings;
use base 'Armadito::Agent::Task';
use JSON;
use Data::Dumper;
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%para
se ) = @_;
$self->{logger}->info( "Error Response : " . $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
$self->{logger}->error( Dumper($obj) );
return $self;
my $json_text = to_json( $self->{jobj} );
$self->{logger}->debug($json_text);
my $response = $self->{glpi_client}->sendRequest(
"url" => $self->{glpi_url} . "/api/alerts",
message => $json_te
:Task::State;
use strict;
use warnings;
use base 'Armadito::Agent::Task';
use Data::Dumper;
use JSON;
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%params);
if ( $param
teobj;
my $json_text = to_json( $self->{jobj} );
my $response = $self->{glpi_client}->sendRequest(
"url" => $self->{agent}->{config}->{server}[0] . "/api/states",
message => $json_text,
met
se ) = @_;
$self->{logger}->info( "Error Response : " . $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
$self->{logger}->error( Dumper($obj) );
return $self;
strict;
use warnings;
use base 'Armadito::Agent::Task';
use MIME::Base64;
use Data::Dumper;
use JSON;
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%params);
if ( $param
se ) = @_;
$self->{logger}->info( "Error Response : " . $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
$self->{logger}->error( Dumper($obj) );
return $self;
fos;
my $json_text = to_json( $self->{jobj} );
my $response = $self->{glpi_client}->sendRequest(
"url" => $self->{agent}->{config}->{server}[0] . "/api/schedulers",
message => $json_text,
m
warnings;
use base 'Armadito::Agent::Task';
use Armadito::Agent::Storage;
use Data::Dumper;
use JSON;
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%params);
if ( $param
= @_;
$self->{logger}->info( "Successful Response : " . $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
if ( defined( $obj->{jobs} ) && ref( $obj->{jobs} ) eq
se ) = @_;
$self->{logger}->info( "Error Response : " . $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
$self->{logger}->error( Dumper($obj) );
return $self;
g2($url) if $self->{logger};
my $headers = HTTP::Headers->new(
'Content-Type' => 'application/json',
'Referer' => $url
);
my $request = HTTP::Request->new(
$params{method} => $url,
$
eURL method. If this is a POST request, a message must be given in params. This should be a valid JSON message.
The following parameters are allowed, as keys of the %params hash :
=over
=item I<url
anciate module. Set task's default logger.
=head2 getJobj ( $self )
Return unblessed object for json encapsulation.
=head2 getVersion ( $self )
Return Antivirus' Version.
=head2 getScanCliPath (
strict;
use warnings;
use base 'Armadito::Agent::Task';
use MIME::Base64;
use Data::Dumper;
use JSON;
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%params);
if ( $param
se ) = @_;
$self->{logger}->info( "Error Response : " . $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
$self->{logger}->error( Dumper($obj) );
return $self;
esults;
my $json_text = to_json( $self->{jobj} );
my $response = $self->{glpi_client}->sendRequest(
"url" => $self->{agent}->{config}->{server}[0] . "/api/scans",
message => $json_text,
met
e 'Armadito::Agent::Task';
use Armadito::Agent::Tools::File qw( readFile );
use Data::Dumper;
use JSON;
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%params);
if ( $param
$self = $self->SUPER::run(%params);
$self->_setEnrollmentKey();
my $json_text = to_json( $self->{jobj} );
print $json_text. "\n";
my $response = $self->{glpi_client}->sendRequest(
"url"
: " . $response->content() . "\n" );
if ( $response->content() =~ /^\s*\{/ ) {
my $obj = from_json( $response->content(), { utf8 => 1 } );
$self->{logger}->error( $obj->{message} );
}
return $
n qw{ POST };
use UNIVERSAL::require;
use URI;
use Encode;
use Data::Dumper;
use URI::Escape;
use JSON;
use Armadito::Agent::HTTP::Client::ArmaditoAV::Event;
use Armadito::Agent::HTTP::Client::Armadi
rmadito-agent',
'Referer' => $url
);
$headers->header( 'Content-Type' => 'application/json' ) if ( $params{method} eq 'POST' );
$headers->header( 'X-Armadito-Token' => $self->{token} )
{
my ( $self, $response ) = @_;
$self->{logger}->info( $response->content() );
my $obj = from_json( $response->content(), { utf8 => 1 } );
# Update armadito agent_id
if ( defined( $obj->{token}
Armadito Antivirus on-demand scan using AV's API REST protocol and then send a brief report in a json formatted POST request to Armadito plugin for GLPI.
=head1 FUNCTIONS
=head2 run ( $self, %param
vent;
use strict;
use warnings;
use base 'Armadito::Agent::HTTP::Client::ArmaditoAV::Event';
use JSON;
sub new {
my ( $class, %params ) = @_;
my $self = $class->SUPER::new(%params);
return $sel
>{jobj}->{task}->{obj} = $obj;
my $json_text = to_json( $self->{taskobj}->{jobj} );
print "JSON formatted str : \n" . $json_text . "\n";
$self->_sendToGLPI($json_text);
$self->{end_polling} = 1;
This task inherits from L<Armadito::Agent::Task:State>. Get Antivirus state and then send it in a json formatted POST request to Armadito plugin for GLPI.
=head1 FUNCTIONS
=head2 run ( $self, %param
This task inherits from L<Armadito::Agent::Task:Alerts>. Get Antivirus' alerts and send them as json messages to armadito glpi plugin.
=head1 FUNCTIONS
=head2 run ( $self, %params )
Run the task.
This task inherits from L<Armadito::Agent::Task:Alerts>. Get Antivirus' alerts and send them as json messages to armadito glpi plugin.
=head1 FUNCTIONS
=head2 run ( $self, %params )
Run the task.
Armadito::Agent::Task:Scan>. Launch an Antivirus on-demand scan and then send a brief report in a json formatted POST request to Armadito plugin for GLPI.
=head1 FUNCTIONS
=head2 run ( $self, %param
nherits from L<Armadito::Agent::Task:AVConfig>. Get Antivirus configuration and then send it in a json formatted POST request to Armadito plugin for GLPI.
=head1 FUNCTIONS
=head2 run ( $self, %param