Merge remote-tracking branch 'origin/develop' into ent-test-corr

This commit is contained in:
Ramon Novoa 2022-06-17 10:29:23 +02:00
commit d53c2f8ed4
7 changed files with 485 additions and 358 deletions

View File

@ -178,6 +178,7 @@ switch ($type) {
break;
}
$query_filter = [];
if (empty($query_filter) === false) {
$query_filter = json_decode($query_filter, true);
}

File diff suppressed because it is too large Load Diff

View File

@ -3559,7 +3559,8 @@ class AgentWizard extends HTML
$this->targetPort,
$this->server,
$this->extraArguments,
(($full_output === false) ? '-Oa -On' : '-Oa')
(($full_output === false) ? '-On' : '-Oa'),
''
);
if ($pure === true) {
@ -3572,7 +3573,12 @@ class AgentWizard extends HTML
if ($full_output === true) {
$output[] = $key.' = '.$oid_unit;
} else {
preg_match('/\.\d+$/', $key, $index);
$index = [];
$index[] = preg_replace('/^'.$oid.'/', '', $key);
if (empty($index) === true) {
preg_match('/\.\d+$/', $key, $index);
}
$tmp = explode(': ', $oid_unit);
$output[$index[0]] = str_replace('"', '', ($tmp[1] ?? ''));
}

View File

@ -1993,7 +1993,8 @@ function get_snmpwalk(
$snmp_port='',
$server_to_exec=0,
$extra_arguments='',
$format='-Oa'
$format='-Oa',
$load_mibs='-m ALL'
) {
global $config;
@ -2057,15 +2058,15 @@ function get_snmpwalk(
case '3':
switch ($snmp3_security_level) {
case 'authNoPriv':
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
case 'noAuthNoPriv':
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -l '.escapeshellarg($snmp3_security_level).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
default:
$command_str = $snmpwalk_bin.' -m ALL '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$format.' '.$extra_arguments.' -v 3'.' -u '.escapeshellarg($snmp3_auth_user).' -A '.escapeshellarg($snmp3_auth_pass).' -l '.escapeshellarg($snmp3_security_level).' -a '.escapeshellarg($snmp3_auth_method).' -x '.escapeshellarg($snmp3_privacy_method).' -X '.escapeshellarg($snmp3_privacy_pass).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
}
break;
@ -2074,7 +2075,7 @@ function get_snmpwalk(
case '2c':
case '1':
default:
$command_str = $snmpwalk_bin.' -m ALL '.$extra_arguments.' '.$format.' -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
$command_str = $snmpwalk_bin.' '.$load_mibs.' '.$extra_arguments.' '.$format.' -v '.escapeshellarg($snmp_version).' -c '.escapeshellarg(io_safe_output($snmp_community)).' '.escapeshellarg($ip_target).' '.$base_oid.' 2> '.$error_redir_dir;
break;
}

View File

@ -814,6 +814,13 @@ select:-internal-list-box {
.margin-left-2 {
margin-left: 2em;
}
.margin-right-05 {
margin-right: 0.5em;
}
.margin-left-05 {
margin-left: 0.5em;
}
.no-border {
border: none;
}

View File

@ -609,15 +609,14 @@ sub print_module {
$data->{critical_instructions} = $conf->{critical_instructions} unless (defined($data->{critical_instructions}) || (!defined($conf->{critical_instructions})));
# Translation compatibility
$data->{'min_warning'} = $data->{'wmin'} if empty($data->{'min_warning'});
$data->{'max_warning'} = $data->{'wmax'} if empty($data->{'max_warning'});
$data->{'min_critical'} = $data->{'cmin'} if empty($data->{'min_critical'});
$data->{'max_critical'} = $data->{'cmax'} if empty($data->{'max_critical'});
$data->{'warning_inverse'} = $data->{'winv'} if empty($data->{'warning_inverse'});
$data->{'critical_inverse'} = $data->{'cinv'} if empty($data->{'critical_inverse'});
$data->{'str_warning'} = $data->{'wstr'} if empty($data->{'str_warning'});
$data->{'str_critical'} = $data->{'cstr'} if empty($data->{'str_critical'});
$data->{min_warning} = $data->{'wmin'} if empty($data->{min_warning});
$data->{max_warning} = $data->{'wmax'} if empty($data->{max_warning});
$data->{min_critical} = $data->{'cmin'} if empty($data->{min_critical});
$data->{max_critical} = $data->{'cmax'} if empty($data->{max_critical});
$data->{warning_inverse} = $data->{'winv'} if empty($data->{warning_inverse});
$data->{critical_inverse} = $data->{'cinv'} if empty($data->{critical_inverse});
$data->{str_warning} = $data->{'wstr'} if empty($data->{str_warning});
$data->{str_critical} = $data->{'cstr'} if empty($data->{str_critical});
$xml_module .= "<module>\n";
$xml_module .= "\t<name><![CDATA[" . $data->{name} . "]]></name>\n";

View File

@ -1628,9 +1628,14 @@ sub database_scan($$$) {
$self->{'summary'}->{'discovered'} += 1;
$self->{'summary'}->{'alive'} += 1;
my $name = $type . ' connection';
if (defined $obj->{'prefix_module_name'} && $obj->{'prefix_module_name'} ne '') {
$name = $obj->{'prefix_module_name'} . $type . ' connection';
}
push @modules,
{
name => $type . ' connection',
name => $name,
type => 'generic_proc',
data => 1,
description => $type . ' availability'
@ -1778,8 +1783,14 @@ sub app_scan($) {
# Update progress
$self->call('update_progress', $global_percent + (90 / (scalar @targets)));
$self->{'summary'}->{'not_alive'} += 1;
my $name = $type . ' connection';
if (defined $obj->{'prefix_module_name'} && $obj->{'prefix_module_name'} ne '') {
$name = $obj->{'prefix_module_name'} . $type . ' connection';
}
push @modules, {
name => $type . ' connection',
name => $name,
type => 'generic_proc',
data => 0,
description => $type . ' availability'