mssql driver settings

This commit is contained in:
fbsanchez 2020-02-18 16:43:36 +01:00
parent dec7733148
commit 85f512db5c
3 changed files with 16 additions and 4 deletions

View File

@ -140,6 +140,9 @@ discoveryserver 1
# Discovery SAP utils (PANDORA FMS ENTERPRISE ONLY)
# sap_utils /usr/share/pandora_server/util/recon_scripts/SAP
# Discovery Microsoft SQL ODBC driver (PANDORA FMS ENTERPRISE ONLY)
# mssql_driver ODBC Driver 17 for SQL Server
# pluginserver : 1 or 0. Set to 1 to activate plugin server with this setup
pluginserver 1

View File

@ -332,6 +332,7 @@ sub pandora_load_config {
$pa_config->{"dynamic_updates"} = 5; # 7.0
$pa_config->{"dynamic_warning"} = 25; # 7.0
$pa_config->{"dynamic_constant"} = 10; # 7.0
$pa_config->{"mssql_driver"} = undef; # 745
# Internal MTA for alerts, each server need its own config.
$pa_config->{"mta_address"} = ''; # Introduced on 2.0
@ -1180,6 +1181,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^dynamic_constant\s+([0-9]*)/i) {
$pa_config->{'dynamic_constant'}= clean_blank($1);
}
elsif ($parametro =~ m/^mssql_driver\s+(.*)/i) {
$pa_config->{'mssql_driver'}= clean_blank($1);
}
elsif ($parametro =~ m/^logstash_host\s+(.*)/i) {
$pa_config->{'logstash_host'}= clean_blank($1);

View File

@ -35,6 +35,7 @@ use constant {
DISCOVERY_CLOUD_AZURE_COMPUTE => 8,
DISCOVERY_DEPLOY_AGENTS => 9,
DISCOVERY_APP_SAP => 10,
DISCOVERY_APP_MICROSOFT_SQL_SERVER => 11,
};
# $DEVNULL
@ -1577,6 +1578,8 @@ sub app_scan($) {
$type = 'MySQL';
} elsif ($self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE) {
$type = 'Oracle';
} elsif ($self->{'task_data'}->{'type'} == DISCOVERY_APP_MICROSOFT_SQL_SERVER) {
$type = 'MSSQL';
} elsif ($self->{'task_data'}->{'type'} == DISCOVERY_APP_SAP) {
$type = 'SAP';
} else {
@ -1659,13 +1662,13 @@ sub app_scan($) {
# Scan connected obj.
if ( $self->{'task_data'}->{'type'} == DISCOVERY_APP_MYSQL
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE) {
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_MICROSOFT_SQL_SERVER
) {
# Database.
$results = $self->database_scan($type, $obj, $global_percent, \@targets);
} elsif ($self->{'task_data'}->{'type'} == DISCOVERY_APP_SAP) {
# SAP scan
$results = $obj->scan();
@ -1766,7 +1769,9 @@ sub scan($) {
if (defined($self->{'task_data'})) {
if ( $self->{'task_data'}->{'type'} == DISCOVERY_APP_MYSQL
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_SAP) {
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_SAP
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_MICROSOFT_SQL_SERVER
) {
# Application scan.
$self->call('message', "Scanning application ...", 6);
return $self->app_scan();