Merge branch 'ent-9203-adaptar-plugin-wizard_wmi_module-a-pandorawmic' into 'develop'

Ent 9203 adaptar plugin wizard wmi module a pandorawmic

See merge request artica/pandorafms!6185
This commit is contained in:
Alejandro Sánchez 2023-07-10 11:24:22 +00:00
commit 91bfd2b3f4
1 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ Get the result of an arithmetic operation using distinct fields in a WMI query (
Usage: $0 [-wmicPath "<path_to_wmic>"] -host "<ip_address>" [-namespace "<namespace>"] -user "<username>" -pass "<password>" -wmiClass "<wmi_class>" -fieldsList "<class_fields_names>" [-queryFilter "<query_filter>"] -operation "<aritmetic_operation>"
-wmicPath Path to wmic command (Default: /usr/bin/wmic)
-wmicPath Path to pandorawmic command (Default: /usr/bin/pandorawmic)
-host Target host
-namespace WMI namespace
@ -84,7 +84,7 @@ if ($Param{Help}){
my $config;
# General parameters
$config->{'wmicPath'} = $Param{wmicPath} || '/usr/bin/wmic';
$config->{'wmicPath'} = $Param{wmicPath} || '/usr/bin/pandorawmic';
$config->{'host'} = $Param{host} || '';
$config->{'namespace'} = $Param{namespace} || '';
$config->{'user'} = $Param{user} || '';
@ -130,9 +130,9 @@ my $output = `$wmi_command 2>/dev/null`;
my @data = split("\n", $output);
if ($data[0] ne 'CLASS: ' . $config->{'wmiClass'}){
print $output;
exit 1;
if (index($data[0], 'CLASS: ' . $config->{'wmiClass'}) != 0) {
print $output;
exit 1;
}
# Parse fields positions