2007-08-02 19:53:07 +02:00
package PandoraFMS::Config ;
##########################################################################
2008-07-22 17:52:34 +02:00
# Configuration Package
# Pandora FMS. the Flexible Monitoring System. http://www.pandorafms.org
2007-08-02 19:53:07 +02:00
##########################################################################
2011-03-14 11:39:31 +01:00
# Copyright (c) 2005-2011 Artica Soluciones Tecnologicas S.L
2007-08-02 19:53:07 +02:00
#
# This program is free software; you can redistribute it and/or
2009-01-24 16:41:39 +01:00
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation; version 2.
2007-08-02 19:53:07 +02:00
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
##########################################################################
use warnings ;
2009-04-14 Ramon Novoa <rnovoa@artica.es>
* pandora_ctl, pandora_network, pandora_wmi, pandora_plugin,
pandora_prediction, bin/pandora_wmi, bin/pandora_plugin,
bin/pandora_prediction, bin/pandora_snmpconsole, bin/pandora_recon,
bin/pandora_network, pandora_recon, pandora_snmpconsole: Deleted
from repository. Old server code and startup scripts.
* Makefile.PL, pandora_server_installer, lib/PandoraFMS/Config.pm
lib/PandoraFMS/DB.pm, lib/PandoraFMS/Tools.pm, bin/pandora_server,
pandora_package_installer, pandora_server: Updated to work with the
new code, removed unneeded dependencies, fixed some bugs etc.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Added
to repository. New server code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1620 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-14 21:13:16 +02:00
use POSIX qw( strftime ) ;
2007-08-02 19:53:07 +02:00
use Time::Local ;
2010-05-19 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Config.pm,
lib/PandoraFMS/Server.pm, lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/GIS.pm, lib/PandoraFMS/WMIServer.pm,
lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/ProducerConsumerServer.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
bin/pandora_server, util/pandora_db.pl, util/gpx2pandora_agent_data.pl,
util/pandora_manage.pl, util/pandora_dbstress.pl: Added the default library path
used by RPM and DEB packages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2755 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-05-19 18:59:00 +02:00
# Default lib dir for RPM and DEB packages
use lib '/usr/lib/perl5' ;
2007-08-02 19:53:07 +02:00
use PandoraFMS::Tools ;
use PandoraFMS::DB ;
2019-03-05 16:12:29 +01:00
2007-08-02 19:53:07 +02:00
require Exporter ;
our @ ISA = ( "Exporter" ) ;
our % EXPORT_TAGS = ( 'all' = > [ qw( ) ] ) ;
our @ EXPORT_OK = ( @ { $ EXPORT_TAGS { 'all' } } ) ;
2008-03-13 19:33:44 +01:00
our @ EXPORT = qw(
2009-12-14 00:38:31 +01:00
pandora_help_screen
2009-11-06 20:48:48 +01:00
pandora_init
pandora_load_config
2009-12-14 00:38:31 +01:00
pandora_start_log
2010-02-10 Sancho Lerena <slerena@artica.es>
* bin/pandora_server: Better error management, avoiding to show Enterprise
loading errors, and showing in console critical errors, helping to identify
silly errors like DB credentials, etc.
Added usage of pandora_get_sharedconfig() to get configuration from DB.
* Config.pm: Updated build. Added pandora_get_sharedconfig(). Force three
config tokens to be readed from DB, using default values if cannot be readen
from database (agentaccess, realtimestat and stats_interval).
* Core.pm: Added new parameter to pandora_event() to pass status of the
event (validated, not validated). Implemented auto-validation of low
priority events: normal/ok events will be always shown as autovalidated, and
warning and normal events will be validated with critical events, and when
a module is restored (normal/ok), all it's warning/critical pending events
will be validated.
Fixed also bug with FF Threshold who doesnt' trigger events until FF + 1
instead FF value.
* Server.pm,
NetworkServer.pm,
Dataserver.pm,
ReconServer.pm: Raise event with status 0 (non validated) by default.
* NetworkServer.pm: Implemented support for SNMP v3.
* util/pandora_db.pm: Very important upgrade to this script. Now will
delete all huge tables (tagente_datos, tagente_datos_string and
tagent_acccess) using several independent blocks (by default 100) avoiding
mysql locks which happen in the past.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2341 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-10 18:32:10 +01:00
pandora_get_sharedconfig
2012-01-24 18:16:56 +01:00
pandora_get_tconfig_token
2018-05-25 12:39:30 +02:00
pandora_get_initial_product_name
pandora_get_initial_copyright_notice
2009-12-14 00:38:31 +01:00
) ;
2007-08-02 19:53:07 +02:00
# version: Defines actual version of Pandora Server for this module only
2020-10-15 10:19:42 +02:00
my $ pandora_version = "7.0NG.750" ;
2020-10-28 01:00:18 +01:00
my $ pandora_build = "201028" ;
2007-08-02 19:53:07 +02:00
our $ VERSION = $ pandora_version . " " . $ pandora_build ;
# Setup hash
my % pa_config ;
# Public functions
##########################################################################
# SUB pandora_help_screen()
2010-05-16 00:32:56 +02:00
# Shows a help screen and exits
2007-08-02 19:53:07 +02:00
##########################################################################
sub help_screen {
2018-05-25 12:39:30 +02:00
print "\nSyntax: \n\n pandora_server [ options ] < fullpathname to configuration file > \n\n" ;
2009-11-13 Ramon Novoa <rnovoa@artica.es>
* conf/pandora_server.conf: Updated configuration tokens.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Config.pm,
lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/PredictionServer.pm,
lib/PandoraFMS/Core.pm, lib/PandoraFMS/ReconServer.pm,
lib/PandoraFMS/DataServer.pm, lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/Tools.pm, lib/PandoraFMS/WMIServer.pm,
bin/pandora_server: Standardized and improved logging.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-11-13 14:52:48 +01:00
print "Following options are optional : \n" ;
2009-12-14 00:38:31 +01:00
print " -v : Verbose mode activated. Writes more information in the logfile \n" ;
print " -d : Debug mode activated. Writes extensive information in the logfile \n" ;
print " -D : Daemon mode (runs in background)\n" ;
print " -P <file> : Store PID to file.\n" ;
print " -q : Quiet startup \n" ;
2014-05-28 11:37:01 +02:00
print " -S <install|uninstall|run>: Manage the win32 service.\n" ;
2009-12-14 00:38:31 +01:00
print " -h : This screen. Shows a little help screen \n" ;
2009-11-13 Ramon Novoa <rnovoa@artica.es>
* conf/pandora_server.conf: Updated configuration tokens.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Config.pm,
lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/PredictionServer.pm,
lib/PandoraFMS/Core.pm, lib/PandoraFMS/ReconServer.pm,
lib/PandoraFMS/DataServer.pm, lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/Tools.pm, lib/PandoraFMS/WMIServer.pm,
bin/pandora_server: Standardized and improved logging.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-11-13 14:52:48 +01:00
print " \n" ;
2007-08-02 19:53:07 +02:00
exit ;
}
##########################################################################
# SUB pandora_init ( %pandora_cfg )
# Makes the initial parameter parsing, initializing and error checking
##########################################################################
sub pandora_init {
my $ pa_config = $ _ [ 0 ] ;
my $ init_string = $ _ [ 1 ] ;
2019-10-22 11:54:27 +02:00
print "\n$init_string $pandora_version Build $pandora_build Copyright (c) 2004-20" . substr ( $ pandora_build , 0 , 2 ) . " " . pandora_get_initial_copyright_notice ( ) . "\n" ;
2009-11-13 Ramon Novoa <rnovoa@artica.es>
* conf/pandora_server.conf: Updated configuration tokens.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Config.pm,
lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/PredictionServer.pm,
lib/PandoraFMS/Core.pm, lib/PandoraFMS/ReconServer.pm,
lib/PandoraFMS/DataServer.pm, lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/Tools.pm, lib/PandoraFMS/WMIServer.pm,
bin/pandora_server: Standardized and improved logging.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-11-13 14:52:48 +01:00
print "This program is OpenSource, licensed under the terms of GPL License version 2.\n" ;
2018-05-25 12:39:30 +02:00
print "You can download latest versions and documentation at official web page.\n\n" ;
2007-08-02 19:53:07 +02:00
# Load config file from command line
if ( $# ARGV == - 1 ) {
2018-05-25 12:39:30 +02:00
print "I need at least one parameter: Complete path to " . pandora_get_initial_product_name ( ) . " Server configuration file \n" ;
2007-08-02 19:53:07 +02:00
help_screen ;
exit ;
}
2009-11-06 20:48:48 +01:00
$ pa_config - > { "verbosity" } = 0 ; # Verbose 1 by default
2009-01-24 16:41:39 +01:00
$ pa_config - > { "daemon" } = 0 ; # Daemon 0 by default
2009-11-06 20:48:48 +01:00
$ pa_config - > { 'PID' } = "" ; # PID file not exist by default
$ pa_config - > { "quiet" } = 0 ; # Daemon 0 by default
2007-08-02 19:53:07 +02:00
# If there are not valid parameters
my $ parametro ;
my $ ltotal = $# ARGV ; my $ ax ;
2009-11-06 20:48:48 +01:00
for ( $ ax = 0 ; $ ax <= $ ltotal ; $ ax + + ) {
2009-12-14 00:38:31 +01:00
$ parametro = $ ARGV [ $ ax ] ;
2009-11-06 20:48:48 +01:00
if ( ( $ parametro =~ m/-h\z/i ) || ( $ parametro =~ m/help\z/i ) ) {
2009-12-14 00:38:31 +01:00
help_screen ( ) ;
2009-11-06 20:48:48 +01:00
}
elsif ( $ parametro =~ m/-v\z/i ) {
2009-12-14 00:38:31 +01:00
$ pa_config - > { "verbosity" } = 5 ;
2009-11-06 20:48:48 +01:00
}
elsif ( $ parametro =~ m/^-P\z/i ) {
2009-12-14 00:38:31 +01:00
$ pa_config - > { 'PID' } = clean_blank ( $ ARGV [ $ ax + 1 ] ) ;
2009-11-06 20:48:48 +01:00
}
elsif ( $ parametro =~ m/-d\z/ ) {
2009-12-14 00:38:31 +01:00
$ pa_config - > { "verbosity" } = 10 ;
2009-11-06 20:48:48 +01:00
}
elsif ( $ parametro =~ m/-q\z/ ) {
2009-12-14 00:38:31 +01:00
$ pa_config - > { "quiet" } = 1 ;
2009-11-06 20:48:48 +01:00
}
elsif ( $ parametro =~ m/-D\z/ ) {
2009-12-14 00:38:31 +01:00
$ pa_config - > { "daemon" } = 1 ;
2009-11-06 20:48:48 +01:00
}
2014-05-28 11:37:01 +02:00
elsif ( $ parametro =~ m/^-S\z/i ) {
$ pa_config - > { 'win32_service' } = clean_blank ( $ ARGV [ $ ax + 1 ] ) ;
}
2009-11-06 20:48:48 +01:00
else {
2009-12-14 00:38:31 +01:00
( $ pa_config - > { "pandora_path" } = $ parametro ) ;
2009-11-06 20:48:48 +01:00
}
}
2007-08-02 19:53:07 +02:00
if ( $ pa_config - > { "pandora_path" } eq "" ) {
2018-05-25 12:39:30 +02:00
print " [ERROR] I need at least one parameter: Complete path to " . pandora_get_initial_product_name ( ) . " configuration file. \n" ;
2009-01-24 16:41:39 +01:00
print " For example: ./pandora_server /etc/pandora/pandora_server.conf \n\n" ;
2007-08-02 19:53:07 +02:00
exit ;
}
}
2010-02-10 Sancho Lerena <slerena@artica.es>
* bin/pandora_server: Better error management, avoiding to show Enterprise
loading errors, and showing in console critical errors, helping to identify
silly errors like DB credentials, etc.
Added usage of pandora_get_sharedconfig() to get configuration from DB.
* Config.pm: Updated build. Added pandora_get_sharedconfig(). Force three
config tokens to be readed from DB, using default values if cannot be readen
from database (agentaccess, realtimestat and stats_interval).
* Core.pm: Added new parameter to pandora_event() to pass status of the
event (validated, not validated). Implemented auto-validation of low
priority events: normal/ok events will be always shown as autovalidated, and
warning and normal events will be validated with critical events, and when
a module is restored (normal/ok), all it's warning/critical pending events
will be validated.
Fixed also bug with FF Threshold who doesnt' trigger events until FF + 1
instead FF value.
* Server.pm,
NetworkServer.pm,
Dataserver.pm,
ReconServer.pm: Raise event with status 0 (non validated) by default.
* NetworkServer.pm: Implemented support for SNMP v3.
* util/pandora_db.pm: Very important upgrade to this script. Now will
delete all huge tables (tagente_datos, tagente_datos_string and
tagent_acccess) using several independent blocks (by default 100) avoiding
mysql locks which happen in the past.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2341 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-10 18:32:10 +01:00
##########################################################################
# Read some config tokens from database set by the console
##########################################################################
sub pandora_get_sharedconfig ($$) {
2012-01-24 18:16:56 +01:00
my ( $ pa_config , $ dbh ) = @ _ ;
2010-02-10 Sancho Lerena <slerena@artica.es>
* bin/pandora_server: Better error management, avoiding to show Enterprise
loading errors, and showing in console critical errors, helping to identify
silly errors like DB credentials, etc.
Added usage of pandora_get_sharedconfig() to get configuration from DB.
* Config.pm: Updated build. Added pandora_get_sharedconfig(). Force three
config tokens to be readed from DB, using default values if cannot be readen
from database (agentaccess, realtimestat and stats_interval).
* Core.pm: Added new parameter to pandora_event() to pass status of the
event (validated, not validated). Implemented auto-validation of low
priority events: normal/ok events will be always shown as autovalidated, and
warning and normal events will be validated with critical events, and when
a module is restored (normal/ok), all it's warning/critical pending events
will be validated.
Fixed also bug with FF Threshold who doesnt' trigger events until FF + 1
instead FF value.
* Server.pm,
NetworkServer.pm,
Dataserver.pm,
ReconServer.pm: Raise event with status 0 (non validated) by default.
* NetworkServer.pm: Implemented support for SNMP v3.
* util/pandora_db.pm: Very important upgrade to this script. Now will
delete all huge tables (tagente_datos, tagente_datos_string and
tagent_acccess) using several independent blocks (by default 100) avoiding
mysql locks which happen in the past.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2341 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-10 18:32:10 +01:00
# Agentaccess option
2012-01-24 18:16:56 +01:00
$ pa_config - > { "agentaccess" } = pandora_get_tconfig_token ( $ dbh , 'agentaccess' , 1 ) ;
2010-02-10 Sancho Lerena <slerena@artica.es>
* bin/pandora_server: Better error management, avoiding to show Enterprise
loading errors, and showing in console critical errors, helping to identify
silly errors like DB credentials, etc.
Added usage of pandora_get_sharedconfig() to get configuration from DB.
* Config.pm: Updated build. Added pandora_get_sharedconfig(). Force three
config tokens to be readed from DB, using default values if cannot be readen
from database (agentaccess, realtimestat and stats_interval).
* Core.pm: Added new parameter to pandora_event() to pass status of the
event (validated, not validated). Implemented auto-validation of low
priority events: normal/ok events will be always shown as autovalidated, and
warning and normal events will be validated with critical events, and when
a module is restored (normal/ok), all it's warning/critical pending events
will be validated.
Fixed also bug with FF Threshold who doesnt' trigger events until FF + 1
instead FF value.
* Server.pm,
NetworkServer.pm,
Dataserver.pm,
ReconServer.pm: Raise event with status 0 (non validated) by default.
* NetworkServer.pm: Implemented support for SNMP v3.
* util/pandora_db.pm: Very important upgrade to this script. Now will
delete all huge tables (tagente_datos, tagente_datos_string and
tagent_acccess) using several independent blocks (by default 100) avoiding
mysql locks which happen in the past.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2341 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-10 18:32:10 +01:00
# Realtimestats 0 disabled, 1 enabled.
# Master servers will generate all the information (global tactical stats).
# and each server will generate it's own server stats (lag, etc).
2012-01-24 18:16:56 +01:00
$ pa_config - > { "realtimestats" } = pandora_get_tconfig_token ( $ dbh , 'realtimestats' , 0 ) ;
2010-02-10 Sancho Lerena <slerena@artica.es>
* bin/pandora_server: Better error management, avoiding to show Enterprise
loading errors, and showing in console critical errors, helping to identify
silly errors like DB credentials, etc.
Added usage of pandora_get_sharedconfig() to get configuration from DB.
* Config.pm: Updated build. Added pandora_get_sharedconfig(). Force three
config tokens to be readed from DB, using default values if cannot be readen
from database (agentaccess, realtimestat and stats_interval).
* Core.pm: Added new parameter to pandora_event() to pass status of the
event (validated, not validated). Implemented auto-validation of low
priority events: normal/ok events will be always shown as autovalidated, and
warning and normal events will be validated with critical events, and when
a module is restored (normal/ok), all it's warning/critical pending events
will be validated.
Fixed also bug with FF Threshold who doesnt' trigger events until FF + 1
instead FF value.
* Server.pm,
NetworkServer.pm,
Dataserver.pm,
ReconServer.pm: Raise event with status 0 (non validated) by default.
* NetworkServer.pm: Implemented support for SNMP v3.
* util/pandora_db.pm: Very important upgrade to this script. Now will
delete all huge tables (tagente_datos, tagente_datos_string and
tagent_acccess) using several independent blocks (by default 100) avoiding
mysql locks which happen in the past.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2341 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-10 18:32:10 +01:00
# Stats_interval option
2012-01-24 18:16:56 +01:00
$ pa_config - > { "stats_interval" } = pandora_get_tconfig_token ( $ dbh , 'stats_interval' , 300 ) ;
2010-02-10 Sancho Lerena <slerena@artica.es>
* bin/pandora_server: Better error management, avoiding to show Enterprise
loading errors, and showing in console critical errors, helping to identify
silly errors like DB credentials, etc.
Added usage of pandora_get_sharedconfig() to get configuration from DB.
* Config.pm: Updated build. Added pandora_get_sharedconfig(). Force three
config tokens to be readed from DB, using default values if cannot be readen
from database (agentaccess, realtimestat and stats_interval).
* Core.pm: Added new parameter to pandora_event() to pass status of the
event (validated, not validated). Implemented auto-validation of low
priority events: normal/ok events will be always shown as autovalidated, and
warning and normal events will be validated with critical events, and when
a module is restored (normal/ok), all it's warning/critical pending events
will be validated.
Fixed also bug with FF Threshold who doesnt' trigger events until FF + 1
instead FF value.
* Server.pm,
NetworkServer.pm,
Dataserver.pm,
ReconServer.pm: Raise event with status 0 (non validated) by default.
* NetworkServer.pm: Implemented support for SNMP v3.
* util/pandora_db.pm: Very important upgrade to this script. Now will
delete all huge tables (tagente_datos, tagente_datos_string and
tagent_acccess) using several independent blocks (by default 100) avoiding
mysql locks which happen in the past.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2341 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-10 18:32:10 +01:00
2012-01-24 18:16:56 +01:00
# Netflow configuration options
$ pa_config - > { "activate_netflow" } = pandora_get_tconfig_token ( $ dbh , 'activate_netflow' , 0 ) ;
$ pa_config - > { "netflow_path" } = pandora_get_tconfig_token ( $ dbh , 'netflow_path' , '/var/spool/pandora/data_in/netflow' ) ;
$ pa_config - > { "netflow_interval" } = pandora_get_tconfig_token ( $ dbh , 'netflow_interval' , 300 ) ;
$ pa_config - > { "netflow_daemon" } = pandora_get_tconfig_token ( $ dbh , 'netflow_daemon' , '/usr/bin/nfcapd' ) ;
2013-01-17 15:38:55 +01:00
# Log module configuration
$ pa_config - > { "log_dir" } = pandora_get_tconfig_token ( $ dbh , 'log_dir' , '/var/spool/pandora/data_in/log' ) ;
$ pa_config - > { "log_interval" } = pandora_get_tconfig_token ( $ dbh , 'log_interval' , 3600 ) ;
2013-05-14 15:56:43 +02:00
# Pandora FMS Console's attachment directory
$ pa_config - > { "attachment_dir" } = pandora_get_tconfig_token ( $ dbh , 'attachment_store' , '/var/www/pandora_console/attachment' ) ;
2015-04-06 15:26:26 +02:00
2015-11-18 15:19:35 +01:00
#Limit of events replicate in metaconsole
$ pa_config - > { 'replication_limit' } = pandora_get_tconfig_token ( $ dbh , 'replication_limit' , 1000 ) ;
2016-08-17 09:12:45 +02:00
$ pa_config - > { 'include_agents' } = pandora_get_tconfig_token ( $ dbh , 'include_agents' , 0 ) ;
2017-03-09 10:57:03 +01:00
#Public url
$ pa_config - > { 'public_url' } = pandora_get_tconfig_token ( $ dbh , 'public_url' , 'http://localhost/pandora_console' ) ;
2017-03-30 09:47:00 +02:00
# Node with a metaconsole license.
# NOTE: This must be read when checking license limits!
#$pa_config->{"node_metaconsole"} = pandora_get_tconfig_token ($dbh, 'node_metaconsole', 0);
2018-03-13 17:52:10 +01:00
$ pa_config - > { "provisioning_mode" } = pandora_get_tconfig_token ( $ dbh , 'provisioning_mode' , '' ) ;
2019-04-02 10:30:53 +02:00
$ pa_config - > { "event_storm_protection" } = pandora_get_tconfig_token ( $ dbh , 'event_storm_protection' , 0 ) ;
2017-03-30 09:47:00 +02:00
2020-06-23 09:21:15 +02:00
$ pa_config - > { "use_custom_encoding" } = pandora_get_tconfig_token ( $ dbh , 'use_custom_encoding' , 0 ) ;
2016-10-27 20:26:28 +02:00
if ( $ pa_config - > { 'include_agents' } eq '' ) {
2016-08-17 09:12:45 +02:00
$ pa_config - > { 'include_agents' } = 0 ;
}
2018-05-17 16:12:44 +02:00
# PandoraFMS product name
$ pa_config - > { 'rb_product_name' } = enterprise_hook (
'pandora_get_product_name' ,
[ $ dbh ]
) ;
$ pa_config - > { 'rb_product_name' } = 'Pandora FMS' unless ( defined ( $ pa_config - > { 'rb_product_name' } ) && $ pa_config - > { 'rb_product_name' } ne '' ) ;
2019-09-10 15:53:47 +02:00
# Mail transport agent configuration. Local configuration takes precedence.
2019-09-11 09:25:40 +02:00
if ( $ pa_config - > { "mta_local" } eq 0 ) {
2019-09-10 15:53:47 +02:00
$ pa_config - > { "mta_address" } = pandora_get_tconfig_token ( $ dbh , 'email_smtpServer' , '' ) ;
$ pa_config - > { "mta_from" } = '"' . pandora_get_tconfig_token ( $ dbh , 'email_from_name' , 'Pandora FMS' ) . '" <' .
pandora_get_tconfig_token ( $ dbh , 'email_from_dir' , 'pandora@pandorafms.org' ) . '>' ;
$ pa_config - > { "mta_pass" } = pandora_get_tconfig_token ( $ dbh , 'email_password' , '' ) ;
$ pa_config - > { "mta_port" } = pandora_get_tconfig_token ( $ dbh , 'email_smtpPort' , '' ) ;
$ pa_config - > { "mta_user" } = pandora_get_tconfig_token ( $ dbh , 'email_username' , '' ) ;
$ pa_config - > { "mta_encryption" } = pandora_get_tconfig_token ( $ dbh , 'email_encryption' , '' ) ;
# Auto-negotiate the auth mechanism, since it cannot be set from the console.
# Do not include PLAIN, it generates the following error:
# 451 4.5.0 SMTP protocol violation, see RFC 2821
$ pa_config - > { "mta_auth" } = 'DIGEST-MD5 CRAM-MD5 LOGIN' ;
# Fix the format of mta_encryption.
if ( $ pa_config - > { "mta_encryption" } eq 'tls' ) {
$ pa_config - > { "mta_encryption" } = 'starttls' ;
}
elsif ( $ pa_config - > { "mta_encryption" } =~ m/^ssl/ ) {
$ pa_config - > { "mta_encryption" } = 'ssl' ;
}
else {
$ pa_config - > { "mta_encryption" } = 'none' ;
}
}
2020-02-20 11:11:44 +01:00
# Server identifier
$ pa_config - > { 'server_unique_identifier' } = pandora_get_tconfig_token ( $ dbh , 'server_unique_identifier' , '' ) ;
2010-02-10 Sancho Lerena <slerena@artica.es>
* bin/pandora_server: Better error management, avoiding to show Enterprise
loading errors, and showing in console critical errors, helping to identify
silly errors like DB credentials, etc.
Added usage of pandora_get_sharedconfig() to get configuration from DB.
* Config.pm: Updated build. Added pandora_get_sharedconfig(). Force three
config tokens to be readed from DB, using default values if cannot be readen
from database (agentaccess, realtimestat and stats_interval).
* Core.pm: Added new parameter to pandora_event() to pass status of the
event (validated, not validated). Implemented auto-validation of low
priority events: normal/ok events will be always shown as autovalidated, and
warning and normal events will be validated with critical events, and when
a module is restored (normal/ok), all it's warning/critical pending events
will be validated.
Fixed also bug with FF Threshold who doesnt' trigger events until FF + 1
instead FF value.
* Server.pm,
NetworkServer.pm,
Dataserver.pm,
ReconServer.pm: Raise event with status 0 (non validated) by default.
* NetworkServer.pm: Implemented support for SNMP v3.
* util/pandora_db.pm: Very important upgrade to this script. Now will
delete all huge tables (tagente_datos, tagente_datos_string and
tagent_acccess) using several independent blocks (by default 100) avoiding
mysql locks which happen in the past.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2341 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-10 18:32:10 +01:00
}
2007-08-02 19:53:07 +02:00
##########################################################################
# Read external configuration file
##########################################################################
2009-04-14 Ramon Novoa <rnovoa@artica.es>
* pandora_ctl, pandora_network, pandora_wmi, pandora_plugin,
pandora_prediction, bin/pandora_wmi, bin/pandora_plugin,
bin/pandora_prediction, bin/pandora_snmpconsole, bin/pandora_recon,
bin/pandora_network, pandora_recon, pandora_snmpconsole: Deleted
from repository. Old server code and startup scripts.
* Makefile.PL, pandora_server_installer, lib/PandoraFMS/Config.pm
lib/PandoraFMS/DB.pm, lib/PandoraFMS/Tools.pm, bin/pandora_server,
pandora_package_installer, pandora_server: Updated to work with the
new code, removed unneeded dependencies, fixed some bugs etc.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Added
to repository. New server code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1620 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-14 21:13:16 +02:00
sub pandora_load_config {
2009-11-06 20:48:48 +01:00
my $ pa_config = $ _ [ 0 ] ;
my $ archivo_cfg = $ pa_config - > { 'pandora_path' } ;
my $ buffer_line ;
my @ command_line ;
my $ tbuf ;
# Default values
$ pa_config - > { 'version' } = $ pandora_version ;
$ pa_config - > { 'build' } = $ pandora_build ;
2011-04-13 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/SNMPServer.pm,
lib/PandoraFMS/Config.pm,
lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/WMIServer.pm,
lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/DB.pm,
lib/PandoraFMS/ProducerConsumerServer.pm,
lib/PandoraFMS/PredictionServer.pm,
lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm,
bin/pandora_server,
util/pandora_db.pl,
util/pandora_manage.pl,
util/recon_scripts/snmpdevices.pl: Adding support for PostgreSQL and
Oracle (not complete).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4213 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-13 18:28:59 +02:00
$ pa_config - > { "dbengine" } = "mysql" ;
2009-11-06 20:48:48 +01:00
$ pa_config - > { "dbuser" } = "pandora" ;
$ pa_config - > { "dbpass" } = "pandora" ;
$ pa_config - > { "dbhost" } = "localhost" ;
2012-04-20 05:56:09 +02:00
$ pa_config - > { 'dbport' } = undef ; # set to standard port of "dbengine" later
2009-11-06 20:48:48 +01:00
$ pa_config - > { "dbname" } = "pandora" ;
$ pa_config - > { "basepath" } = $ pa_config - > { 'pandora_path' } ; # Compatibility with Pandora 1.1
$ pa_config - > { "incomingdir" } = "/var/spool/pandora/data_in" ;
2016-10-28 19:22:07 +02:00
$ pa_config - > { "user" } = "pandora" ; # environment settings default user owner for files generated
$ pa_config - > { "group" } = "apache" ; # environment settings default group owner for files generated
$ pa_config - > { "umask" } = "0007" ; # environment settings umask applied over chmod (A & (not B))
2009-11-06 20:48:48 +01:00
$ pa_config - > { "server_threshold" } = 30 ;
$ pa_config - > { "alert_threshold" } = 60 ;
2017-02-20 09:50:57 +01:00
$ pa_config - > { "graph_precision" } = 1 ;
2015-11-10 13:39:21 +01:00
$ pa_config - > { "log_file" } = "/var/log/pandora_server.log" ;
$ pa_config - > { "errorlog_file" } = "/var/log/pandora_server.error" ;
2009-11-06 20:48:48 +01:00
$ pa_config - > { "networktimeout" } = 5 ; # By default, not in config file yet
$ pa_config - > { "pandora_master" } = 1 ; # on by default
$ pa_config - > { "pandora_check" } = 0 ; # Deprecated since 2.0
$ pa_config - > { "servername" } = `hostname` ;
$ pa_config - > { "servername" } =~ s/\s//g ; # Replace ' ' chars
$ pa_config - > { "dataserver" } = 1 ; # default
$ pa_config - > { "networkserver" } = 1 ; # default
$ pa_config - > { "snmpconsole" } = 1 ; # default
2019-03-04 15:01:50 +01:00
$ pa_config - > { "discoveryserver" } = 0 ; # default
2009-11-06 20:48:48 +01:00
$ pa_config - > { "wmiserver" } = 1 ; # default
$ pa_config - > { "pluginserver" } = 1 ; # default
$ pa_config - > { "predictionserver" } = 1 ; # default
$ pa_config - > { "exportserver" } = 1 ; # default
$ pa_config - > { "inventoryserver" } = 1 ; # default
$ pa_config - > { "webserver" } = 1 ; # 3.0
2017-05-05 12:54:55 +02:00
$ pa_config - > { "web_timeout" } = 60 ; # 6.0SP5
2016-06-13 13:51:55 +02:00
$ pa_config - > { "transactionalserver" } = 0 ; # Default 0, introduced on 6.1
$ pa_config - > { "transactional_threads" } = 1 ; # Default 1, introduced on 6.1
$ pa_config - > { "transactional_threshold" } = 2 ; # Default 2, introduced on 6.1
$ pa_config - > { "transactional_pool" } = $ pa_config - > { "incomingdir" } . "/" . "trans" ; # Default, introduced on 6.1
2009-11-06 20:48:48 +01:00
$ pa_config - > { 'snmp_logfile' } = "/var/log/pandora_snmptrap.log" ;
$ pa_config - > { "network_threads" } = 3 ; # Fixed default
$ pa_config - > { "keepalive" } = 60 ; # 60 Seconds initially for server keepalive
$ pa_config - > { "keepalive_orig" } = $ pa_config - > { "keepalive" } ;
$ pa_config - > { "icmp_checks" } = 1 ; # Introduced on 1.3.1
2015-03-18 16:21:39 +01:00
$ pa_config - > { "icmp_packets" } = 1 ; # > 5.1SP2
2009-11-06 20:48:48 +01:00
$ pa_config - > { "alert_recovery" } = 0 ; # Introduced on 1.3.1
$ pa_config - > { "snmp_checks" } = 1 ; # Introduced on 1.3.1
$ pa_config - > { "snmp_timeout" } = 8 ; # Introduced on 1.3.1
2019-12-23 17:28:40 +01:00
$ pa_config - > { "rcmd_timeout" } = 10 ; # Introduced on 7.0.740
$ pa_config - > { "rcmd_timeout_bin" } = '/usr/bin/timeout' ; # Introduced on 7.0.743
2009-11-06 20:48:48 +01:00
$ pa_config - > { "snmp_trapd" } = '/usr/sbin/snmptrapd' ; # 3.0
$ pa_config - > { "tcp_checks" } = 1 ; # Introduced on 1.3.1
$ pa_config - > { "tcp_timeout" } = 20 ; # Introduced on 1.3.1
$ pa_config - > { "snmp_proc_deadresponse" } = 1 ; # Introduced on 1.3.1 10 Feb08
$ pa_config - > { "plugin_threads" } = 2 ; # Introduced on 2.0
2012-02-01 12:41:52 +01:00
$ pa_config - > { "plugin_exec" } = '/usr/bin/timeout' ; # 3.0
2009-11-06 20:48:48 +01:00
$ pa_config - > { "recon_threads" } = 2 ; # Introduced on 2.0
2019-02-21 15:07:51 +01:00
$ pa_config - > { "discovery_threads" } = 2 ; # Introduced on 732
2009-11-06 20:48:48 +01:00
$ pa_config - > { "prediction_threads" } = 1 ; # Introduced on 2.0
$ pa_config - > { "plugin_timeout" } = 5 ; # Introduced on 2.0
$ pa_config - > { "wmi_threads" } = 2 ; # Introduced on 2.0
$ pa_config - > { "wmi_timeout" } = 5 ; # Introduced on 2.0
2009-04-14 Ramon Novoa <rnovoa@artica.es>
* pandora_ctl, pandora_network, pandora_wmi, pandora_plugin,
pandora_prediction, bin/pandora_wmi, bin/pandora_plugin,
bin/pandora_prediction, bin/pandora_snmpconsole, bin/pandora_recon,
bin/pandora_network, pandora_recon, pandora_snmpconsole: Deleted
from repository. Old server code and startup scripts.
* Makefile.PL, pandora_server_installer, lib/PandoraFMS/Config.pm
lib/PandoraFMS/DB.pm, lib/PandoraFMS/Tools.pm, bin/pandora_server,
pandora_package_installer, pandora_server: Updated to work with the
new code, removed unneeded dependencies, fixed some bugs etc.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Added
to repository. New server code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1620 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-14 21:13:16 +02:00
$ pa_config - > { "wmi_client" } = 'wmic' ; # 3.0
2009-11-06 20:48:48 +01:00
$ pa_config - > { "dataserver_threads" } = 2 ; # Introduced on 2.0
$ pa_config - > { "inventory_threads" } = 2 ; # 2.1
$ pa_config - > { "export_threads" } = 1 ; # 3.0
$ pa_config - > { "web_threads" } = 1 ; # 3.0
2020-06-25 16:34:09 +02:00
$ pa_config - > { "web_engine" } = 'curl' ; # 5.1
2010-01-25 19:36:23 +01:00
$ pa_config - > { "activate_gis" } = 0 ; # 3.1
2010-02-05 16:27:25 +01:00
$ pa_config - > { "location_error" } = 50 ; # 3.1
2018-07-05 15:01:23 +02:00
$ pa_config - > { "recon_reverse_geolocation_file" } = '' ; # 3.1
2010-02-15 21:34:57 +01:00
$ pa_config - > { "recon_location_scatter_radius" } = 50 ; # 3.1
2010-02-25 18:09:19 +01:00
$ pa_config - > { "update_parent" } = 0 ; # 3.1
2011-03-09 14:49:30 +01:00
$ pa_config - > { "google_maps_description" } = 0 ;
$ pa_config - > { 'openstreetmaps_description' } = 0 ;
2011-05-30 12:21:15 +02:00
$ pa_config - > { "eventserver" } = 1 ; # 4.0
$ pa_config - > { "event_window" } = 3600 ; # 4.0
2019-11-19 11:56:11 +01:00
$ pa_config - > { "log_window" } = 3600 ; # 7.741
2019-11-21 17:47:21 +01:00
$ pa_config - > { "preload_windows" } = 0 ; # 7.741
2011-10-20 11:38:27 +02:00
$ pa_config - > { "icmpserver" } = 0 ; # 4.0
2011-06-20 18:32:29 +02:00
$ pa_config - > { "icmp_threads" } = 3 ; # 4.0
2011-10-20 11:38:27 +02:00
$ pa_config - > { "snmpserver" } = 0 ; # 4.0
2011-06-22 18:39:00 +02:00
$ pa_config - > { "snmp_threads" } = 3 ; # 4.0
$ pa_config - > { "block_size" } = 15 ; # 4.0
2011-03-09 14:49:30 +01:00
$ pa_config - > { "max_queue_files" } = 500 ;
2012-02-20 18:47:08 +01:00
$ pa_config - > { "snmp_ignore_authfailure" } = 1 ; # 5.0
$ pa_config - > { "snmp_pdu_address" } = 0 ; # 5.0
2013-08-13 19:04:56 +02:00
$ pa_config - > { "snmp_storm_protection" } = 0 ; # 5.0
$ pa_config - > { "snmp_storm_timeout" } = 600 ; # 5.0
2016-08-09 12:11:37 +02:00
$ pa_config - > { "snmp_delay" } = 0 ; # > 6.0SP3
2014-07-28 18:24:40 +02:00
$ pa_config - > { "snmpconsole_threads" } = 1 ; # 5.1
$ pa_config - > { "translate_variable_bindings" } = 0 ; # 5.1
$ pa_config - > { "translate_enterprise_strings" } = 1 ; # 5.1
2017-02-22 12:59:29 +01:00
$ pa_config - > { "syncserver" } = 0 ; # 7.0
$ pa_config - > { "sync_address" } = '' ; # 7.0
2017-02-27 16:05:26 +01:00
$ pa_config - > { "sync_block_size" } = 65535 ; # 7.0
2017-02-24 08:19:02 +01:00
$ pa_config - > { "sync_ca" } = '' ; # 7.0
$ pa_config - > { "sync_cert" } = '' ; # 7.0
$ pa_config - > { "sync_key" } = '' ; # 7.0
2017-02-22 12:59:29 +01:00
$ pa_config - > { "sync_port" } = '41121' ; # 7.0
$ pa_config - > { "sync_retries" } = 2 ; # 7.0
2017-02-24 08:19:02 +01:00
$ pa_config - > { "sync_timeout" } = 5 ; # 7.0
2017-03-01 14:58:20 +01:00
$ pa_config - > { "dynamic_updates" } = 5 ; # 7.0
2017-03-02 15:02:51 +01:00
$ pa_config - > { "dynamic_warning" } = 25 ; # 7.0
$ pa_config - > { "dynamic_constant" } = 10 ; # 7.0
2012-02-20 18:47:08 +01:00
2009-11-06 20:48:48 +01:00
# Internal MTA for alerts, each server need its own config.
2019-09-10 15:53:47 +02:00
$ pa_config - > { "mta_address" } = '' ; # Introduced on 2.0
$ pa_config - > { "mta_port" } = '' ; # Introduced on 2.0
2009-11-06 20:48:48 +01:00
$ pa_config - > { "mta_user" } = '' ; # Introduced on 2.0
$ pa_config - > { "mta_pass" } = '' ; # Introduced on 2.0
2010-05-16 00:32:56 +02:00
$ pa_config - > { "mta_auth" } = 'none' ; # Introduced on 2.0 (Support LOGIN PLAIN CRAM-MD5 DIGEST-MD)
2009-11-06 20:48:48 +01:00
$ pa_config - > { "mta_from" } = 'pandora@localhost' ; # Introduced on 2.0
2019-09-11 09:25:40 +02:00
$ pa_config - > { "mta_encryption" } = 'none' ; # 7.0 739
$ pa_config - > { "mta_local" } = 0 ; # 7.0 739
2013-06-19 11:53:28 +02:00
$ pa_config - > { "mail_in_separate" } = 1 ; # 1: eMail deliver alert mail in separate mails.
# 0: eMail deliver 1 mail with all destination.
2008-06-13 18:42:35 +02:00
2009-08-19 21:49:55 +02:00
# nmap for recon OS fingerprinting and tcpscan (optional)
$ pa_config - > { "nmap" } = "/usr/bin/nmap" ;
2014-08-07 12:43:25 +02:00
$ pa_config - > { "nmap_timing_template" } = 2 ; # > 5.1
2014-08-14 18:09:55 +02:00
$ pa_config - > { "recon_timing_template" } = 3 ; # > 5.1
2009-08-19 21:49:55 +02:00
2015-02-09 12:00:34 +01:00
$ pa_config - > { "fping" } = "/usr/sbin/fping" ; # > 5.1SP2
2014-12-05 11:07:07 +01:00
2019-11-21 18:21:46 +01:00
# Discovery SAP
$ pa_config - > { "java" } = "/usr/bin/java" ;
# Discovery SAP utils
$ pa_config - > { "sap_utils" } = "/usr/share/pandora_server/util/recon_scripts/SAP" ;
2019-11-26 15:47:04 +01:00
# Discovery SAP Artica environment
$ pa_config - > { "sap_artica_test" } = 0 ;
2019-11-21 18:21:46 +01:00
2019-12-19 11:48:20 +01:00
# Remote execution modules, option ssh_launcher
$ pa_config - > { "ssh_launcher" } = "/usr/bin/ssh_launcher" ;
2011-06-22 18:39:00 +02:00
# braa for enterprise snmp server
2011-08-12 11:30:28 +02:00
$ pa_config - > { "braa" } = "/usr/bin/braa" ;
2011-06-22 18:39:00 +02:00
2013-03-20 16:50:41 +01:00
# SNMP enterprise retries (for braa)
$ pa_config - > { "braa_retries" } = 3 ; # 5.0
2009-08-19 21:49:55 +02:00
# Xprobe2 for recon OS fingerprinting and tcpscan (optional)
2009-09-25 02:09:15 +02:00
$ pa_config - > { "xprobe2" } = "/usr/bin/xprobe2" ;
2009-08-19 21:49:55 +02:00
2019-09-24 19:07:55 +02:00
# Winexe allows to exec commands on remote windows systems (optional)
$ pa_config - > { "winexe" } = "/usr/bin/winexe" ;
# PsExec allows to exec commands on remote windows systems from windows servers (optional)
$ pa_config - > { "psexec" } = 'C:\PandoraFMS\Pandora_Server\bin\PsExec.exe' ;
2009-03-04 18:15:39 +01:00
2019-09-24 19:07:55 +02:00
# plink allows to exec commands on remote linux systems from windows servers (optional)
$ pa_config - > { "plink" } = 'C:\PandoraFMS\Pandora_Server\bin\plink.exe' ;
2009-03-04 18:15:39 +01:00
# Snmpget for snmpget system command (optional)
$ pa_config - > { "snmpget" } = "/usr/bin/snmpget" ;
2014-05-30 12:01:23 +02:00
$ pa_config - > { 'autocreate_group' } = - 1 ;
2019-07-25 13:00:40 +02:00
$ pa_config - > { 'autocreate_group_force' } = 1 ;
2008-06-17 Sancho Lerena <slerena@artica.es>
* config.pm: Added options for xprobe2, and autocreate.
* tools.pm: Added functions pandora_create_agent(), pandora_get_os(),
and pandora_event() (this has been moved from DB.pm).
* pandora_server.conf: Added options for xprobe2, autocreate and
autocreate_group.
* pandora_network: Added support for TCP scanning (not implemented in
console yet), parent detection using traceroute, OS fingerprinting with
xprobe2, event creation using central functions, and some optimizations.
* pandora_server: Added support for agent autocreation, OS detection from
the XML header, and event notification "new_agent" type.
* pandora_recon: First code to implement traceroute functionality
using Pureperl module. Added code for remote OS fingerprinting.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@874 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 19:26:03 +02:00
$ pa_config - > { 'autocreate' } = 1 ;
2008-07-22 17:52:34 +02:00
# max log size (bytes)
2014-09-16 16:22:13 +02:00
$ pa_config - > { 'max_log_size' } = 1048576 ;
2008-06-17 Sancho Lerena <slerena@artica.es>
* config.pm: Added options for xprobe2, and autocreate.
* tools.pm: Added functions pandora_create_agent(), pandora_get_os(),
and pandora_event() (this has been moved from DB.pm).
* pandora_server.conf: Added options for xprobe2, autocreate and
autocreate_group.
* pandora_network: Added support for TCP scanning (not implemented in
console yet), parent detection using traceroute, OS fingerprinting with
xprobe2, event creation using central functions, and some optimizations.
* pandora_server: Added support for agent autocreation, OS detection from
the XML header, and event notification "new_agent" type.
* pandora_recon: First code to implement traceroute functionality
using Pureperl module. Added code for remote OS fingerprinting.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@874 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 19:26:03 +02:00
2014-09-16 12:27:39 +02:00
# max log generation
$ pa_config - > { 'max_log_generation' } = 1 ;
2009-08-24 20:25:42 +02:00
# Ignore the timestamp in the XML and use the file timestamp instead
2020-05-26 13:56:39 +02:00
# If 1 => uses timestamp from received XML #5763.
$ pa_config - > { 'use_xml_timestamp' } = 1 ;
2009-09-02 11:52:55 +02:00
2009-10-07 17:10:14 +02:00
# Server restart delay in seconds
2009-11-06 20:48:48 +01:00
$ pa_config - > { 'restart_delay' } = 60 ;
2009-10-07 17:10:14 +02:00
# Auto restart every x seconds
2009-11-06 20:48:48 +01:00
$ pa_config - > { 'auto_restart' } = 0 ;
2009-10-07 17:10:14 +02:00
2009-11-13 Ramon Novoa <rnovoa@artica.es>
* conf/pandora_server.conf: Updated configuration tokens.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Config.pm,
lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/PredictionServer.pm,
lib/PandoraFMS/Core.pm, lib/PandoraFMS/ReconServer.pm,
lib/PandoraFMS/DataServer.pm, lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/Tools.pm, lib/PandoraFMS/WMIServer.pm,
bin/pandora_server: Standardized and improved logging.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-11-13 14:52:48 +01:00
# Restart server on error
$ pa_config - > { 'restart' } = 0 ;
2010-02-18 18:21:40 +01:00
# Self monitoring
$ pa_config - > { 'self_monitoring' } = 0 ;
2010-02-10 Sancho Lerena <slerena@artica.es>
* bin/pandora_server: Better error management, avoiding to show Enterprise
loading errors, and showing in console critical errors, helping to identify
silly errors like DB credentials, etc.
Added usage of pandora_get_sharedconfig() to get configuration from DB.
* Config.pm: Updated build. Added pandora_get_sharedconfig(). Force three
config tokens to be readed from DB, using default values if cannot be readen
from database (agentaccess, realtimestat and stats_interval).
* Core.pm: Added new parameter to pandora_event() to pass status of the
event (validated, not validated). Implemented auto-validation of low
priority events: normal/ok events will be always shown as autovalidated, and
warning and normal events will be validated with critical events, and when
a module is restored (normal/ok), all it's warning/critical pending events
will be validated.
Fixed also bug with FF Threshold who doesnt' trigger events until FF + 1
instead FF value.
* Server.pm,
NetworkServer.pm,
Dataserver.pm,
ReconServer.pm: Raise event with status 0 (non validated) by default.
* NetworkServer.pm: Implemented support for SNMP v3.
* util/pandora_db.pm: Very important upgrade to this script. Now will
delete all huge tables (tagente_datos, tagente_datos_string and
tagent_acccess) using several independent blocks (by default 100) avoiding
mysql locks which happen in the past.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2341 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-10 18:32:10 +01:00
2014-10-15 15:06:57 +02:00
# Self monitoring interval
$ pa_config - > { 'self_monitoring_interval' } = 300 ; # 5.1SP1
2019-10-22 11:54:27 +02:00
# Sample Agent
$ pa_config - > { 'sample_agent' } = 0 ;
# Sample agent interval
$ pa_config - > { 'sample_agent_interval' } = 600 ;
2012-10-24 11:38:08 +02:00
# Process XML data files as a stack
$ pa_config - > { "dataserver_lifo" } = 0 ; # 5.0
2012-12-13 18:07:23 +01:00
# Patrol process of policies queue
$ pa_config - > { "policy_manager" } = 0 ; # 5.0
# Event replication process
$ pa_config - > { "event_replication" } = 0 ; # 5.0
2013-01-31 19:02:41 +01:00
# Event auto-validation
$ pa_config - > { "event_auto_validation" } = 1 ; # 5.0
2013-07-01 16:05:44 +02:00
# Export events to a text file
$ pa_config - > { "event_file" } = '' ; # 5.0
2013-09-04 15:28:13 +02:00
# Default event messages
$ pa_config - > { "text_going_down_normal" } = "Module '_module_' is going to NORMAL (_data_)" ; # 5.0
$ pa_config - > { "text_going_up_critical" } = "Module '_module_' is going to CRITICAL (_data_)" ; # 5.0
$ pa_config - > { "text_going_up_warning" } = "Module '_module_' is going to WARNING (_data_)" ; # 5.0
$ pa_config - > { "text_going_down_warning" } = "Module '_module_' is going to WARNING (_data_)" ; # 5.0
$ pa_config - > { "text_going_unknown" } = "Module '_module_' is going to UNKNOWN" ; # 5.0
2013-09-09 18:09:34 +02:00
# Event auto-expiry time
$ pa_config - > { "event_expiry_time" } = 0 ; # 5.0
# Event auto-expiry time window
$ pa_config - > { "event_expiry_window" } = 86400 ; # 5.0
2014-05-30 14:26:40 +02:00
# Event auto-expiry time window
$ pa_config - > { "claim_back_snmp_modules" } = 1 ; # 5.1
2013-09-09 18:09:34 +02:00
2014-10-01 11:58:45 +02:00
# Auto-recovery of asynchronous modules.
$ pa_config - > { "async_recovery" } = 1 ; # 5.1SP1
2015-03-09 16:11:05 +01:00
# Database password encryption passphrase
$ pa_config - > { "encryption_passphrase" } = '' ; # 6.0
# Unknown interval (as a multiple of the module's interval)
$ pa_config - > { "unknown_interval" } = 2 ; # > 5.1SP2
2010-02-10 Sancho Lerena <slerena@artica.es>
* bin/pandora_server: Better error management, avoiding to show Enterprise
loading errors, and showing in console critical errors, helping to identify
silly errors like DB credentials, etc.
Added usage of pandora_get_sharedconfig() to get configuration from DB.
* Config.pm: Updated build. Added pandora_get_sharedconfig(). Force three
config tokens to be readed from DB, using default values if cannot be readen
from database (agentaccess, realtimestat and stats_interval).
* Core.pm: Added new parameter to pandora_event() to pass status of the
event (validated, not validated). Implemented auto-validation of low
priority events: normal/ok events will be always shown as autovalidated, and
warning and normal events will be validated with critical events, and when
a module is restored (normal/ok), all it's warning/critical pending events
will be validated.
Fixed also bug with FF Threshold who doesnt' trigger events until FF + 1
instead FF value.
* Server.pm,
NetworkServer.pm,
Dataserver.pm,
ReconServer.pm: Raise event with status 0 (non validated) by default.
* NetworkServer.pm: Implemented support for SNMP v3.
* util/pandora_db.pm: Very important upgrade to this script. Now will
delete all huge tables (tagente_datos, tagente_datos_string and
tagent_acccess) using several independent blocks (by default 100) avoiding
mysql locks which happen in the past.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2341 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-10 18:32:10 +01:00
# -------------------------------------------------------------------------
# This values are not stored in .conf files.
# This values should be stored in database, not in .conf files!
# Default values are set here because if they are not present in config DB
# don't get an error later.
$ pa_config - > { "realtimestats" } = 0 ;
$ pa_config - > { "stats_interval" } = 300 ;
$ pa_config - > { "agentaccess" } = 1 ;
2013-01-31 19:02:41 +01:00
$ pa_config - > { "event_storm_protection" } = 0 ;
2020-06-23 09:21:15 +02:00
$ pa_config - > { "use_custom_encoding" } = 0 ;
2017-03-30 09:47:00 +02:00
$ pa_config - > { "node_metaconsole" } = 0 ; # > 7.0NG
2010-02-10 Sancho Lerena <slerena@artica.es>
* bin/pandora_server: Better error management, avoiding to show Enterprise
loading errors, and showing in console critical errors, helping to identify
silly errors like DB credentials, etc.
Added usage of pandora_get_sharedconfig() to get configuration from DB.
* Config.pm: Updated build. Added pandora_get_sharedconfig(). Force three
config tokens to be readed from DB, using default values if cannot be readen
from database (agentaccess, realtimestat and stats_interval).
* Core.pm: Added new parameter to pandora_event() to pass status of the
event (validated, not validated). Implemented auto-validation of low
priority events: normal/ok events will be always shown as autovalidated, and
warning and normal events will be validated with critical events, and when
a module is restored (normal/ok), all it's warning/critical pending events
will be validated.
Fixed also bug with FF Threshold who doesnt' trigger events until FF + 1
instead FF value.
* Server.pm,
NetworkServer.pm,
Dataserver.pm,
ReconServer.pm: Raise event with status 0 (non validated) by default.
* NetworkServer.pm: Implemented support for SNMP v3.
* util/pandora_db.pm: Very important upgrade to this script. Now will
delete all huge tables (tagente_datos, tagente_datos_string and
tagent_acccess) using several independent blocks (by default 100) avoiding
mysql locks which happen in the past.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2341 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-10 18:32:10 +01:00
# -------------------------------------------------------------------------
2013-11-07 17:23:44 +01:00
#SNMP Forwarding tokens
$ pa_config - > { "snmp_forward_trap" } = 0 ;
$ pa_config - > { "snmp_forward_secName" } = '' ;
$ pa_config - > { "snmp_forward_engineid" } = '' ;
$ pa_config - > { "snmp_forward_authProtocol" } = '' ;
$ pa_config - > { "snmp_forward_authPassword" } = '' ;
$ pa_config - > { "snmp_forward_community" } = 'public' ;
$ pa_config - > { "snmp_forward_privProtocol" } = '' ;
$ pa_config - > { "snmp_forward_privPassword" } = '' ;
$ pa_config - > { "snmp_forward_secLevel" } = '' ;
$ pa_config - > { "snmp_forward_version" } = 2 ;
$ pa_config - > { "snmp_forward_ip" } = '' ;
2015-09-30 15:15:50 +02:00
# Global Timeout for Custom Commands Alerts
$ pa_config - > { "global_alert_timeout" } = 15 ; # 6.0
2015-10-09 16:00:34 +02:00
# Server Remote Config
$ pa_config - > { "remote_config" } = 0 ; # 6.0
2013-11-07 17:23:44 +01:00
2015-10-15 10:55:38 +02:00
# Remote config server address
$ pa_config - > { "remote_config_address" } = 'localhost' ; # 6.0
# Remote config server port
$ pa_config - > { "remote_config_port" } = 41121 ; # 6.0
# Remote config server options
$ pa_config - > { "remote_config_opts" } = '' ; # 6.0
2015-10-15 11:51:09 +02:00
# Temp path for file sendinn and receiving
$ pa_config - > { "temporal" } = '/tmp' ; # 6.0
2010-02-10 Sancho Lerena <slerena@artica.es>
* bin/pandora_server: Better error management, avoiding to show Enterprise
loading errors, and showing in console critical errors, helping to identify
silly errors like DB credentials, etc.
Added usage of pandora_get_sharedconfig() to get configuration from DB.
* Config.pm: Updated build. Added pandora_get_sharedconfig(). Force three
config tokens to be readed from DB, using default values if cannot be readen
from database (agentaccess, realtimestat and stats_interval).
* Core.pm: Added new parameter to pandora_event() to pass status of the
event (validated, not validated). Implemented auto-validation of low
priority events: normal/ok events will be always shown as autovalidated, and
warning and normal events will be validated with critical events, and when
a module is restored (normal/ok), all it's warning/critical pending events
will be validated.
Fixed also bug with FF Threshold who doesnt' trigger events until FF + 1
instead FF value.
* Server.pm,
NetworkServer.pm,
Dataserver.pm,
ReconServer.pm: Raise event with status 0 (non validated) by default.
* NetworkServer.pm: Implemented support for SNMP v3.
* util/pandora_db.pm: Very important upgrade to this script. Now will
delete all huge tables (tagente_datos, tagente_datos_string and
tagent_acccess) using several independent blocks (by default 100) avoiding
mysql locks which happen in the past.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2341 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-10 18:32:10 +01:00
2015-11-13 16:27:41 +01:00
# Warmup intervals.
$ pa_config - > { "warmup_alert_interval" } = 0 ; # 6.1
$ pa_config - > { "warmup_alert_on" } = 0 ; # 6.1
$ pa_config - > { "warmup_event_interval" } = 0 ; # 6.1
$ pa_config - > { "warmup_event_on" } = 0 ; # 6.1
$ pa_config - > { "warmup_unknown_interval" } = 300 ; # 6.1
$ pa_config - > { "warmup_unknown_on" } = 1 ; # 6.1
2017-08-25 17:03:26 +02:00
# Logstash
$ pa_config - > { "logstash_host" } = '' ;
$ pa_config - > { "logstash_port" } = 0 ;
2017-08-23 09:35:17 +02:00
$ pa_config - > { "wuxserver" } = 1 ; # 7.0
$ pa_config - > { "wux_host" } = undef ; # 7.0
$ pa_config - > { "wux_port" } = 4444 ; # 7.0
$ pa_config - > { "wux_browser" } = "*firefox" ; # 7.0
2017-12-01 12:26:13 +01:00
$ pa_config - > { "wux_webagent_timeout" } = 15 ; # 7.0
2020-04-22 16:09:12 +02:00
$ pa_config - > { "clean_wux_sessions" } = 1 ; # 7.0.746 (only selenium 3)
2017-08-23 09:35:17 +02:00
2017-11-15 11:08:39 +01:00
# Syslog Server
$ pa_config - > { "syslogserver" } = 1 ; # 7.0.716
$ pa_config - > { "syslog_file" } = '/var/log/messages/' ; # 7.0.716
$ pa_config - > { "syslog_max" } = 65535 ; # 7.0.716
$ pa_config - > { "syslog_threads" } = 4 ; # 7.0.716
2017-09-05 10:00:24 +02:00
2016-08-17 09:12:45 +02:00
#$pa_config->{'include_agents'} = 0; #6.1
2016-11-15 11:28:52 +01:00
#
# External .enc files for XML::Parser.
$ pa_config - > { "enc_dir" } = "" ; # > 6.0SP4
2016-07-04 15:46:56 +02:00
2016-11-29 09:11:00 +01:00
# Enable (1) or disable (0) events related to the unknown status.
$ pa_config - > { "unknown_events" } = 1 ; # > 6.0SP4
2017-12-05 11:13:37 +01:00
$ pa_config - > { "thread_log" } = 0 ; # 7.0.717
2018-01-11 16:00:22 +01:00
$ pa_config - > { "unknown_updates" } = 0 ; # 7.0.718
2018-03-13 17:52:10 +01:00
$ pa_config - > { "provisioningserver" } = 1 ; # 7.0 720
$ pa_config - > { "provisioningserver_threads" } = 1 ; # 7.0 720
$ pa_config - > { "provisioning_cache_interval" } = 300 ; # 7.0 720
2018-08-08 11:27:56 +02:00
2018-07-04 18:39:06 +02:00
$ pa_config - > { "autoconfigure_agents" } = 1 ; # 7.0 725
2018-08-08 11:27:56 +02:00
2018-08-08 09:07:18 +02:00
$ pa_config - > { 'snmp_extlog' } = "" ; # 7.0 726
2019-01-14 15:16:36 +01:00
$ pa_config - > { "fsnmp" } = "/usr/bin/pandorafsnmp" ; # 7.0 732
2019-07-31 09:06:51 +02:00
$ pa_config - > { "event_inhibit_alerts" } = 0 ; # 7.0 737
2007-08-02 19:53:07 +02:00
# Check for UID0
2009-11-06 20:48:48 +01:00
if ( $ pa_config - > { "quiet" } != 0 ) {
2009-12-14 00:38:31 +01:00
if ( $> == 0 ) {
printf " [W] Not all Pandora FMS components need to be executed as root\n" ;
printf " please consider starting it with a non-privileged user.\n" ;
}
2009-11-06 20:48:48 +01:00
}
2008-03-13 19:33:44 +01:00
2007-08-02 19:53:07 +02:00
# Check for file
2010-05-19 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Config.pm,
lib/PandoraFMS/Server.pm, lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/GIS.pm, lib/PandoraFMS/WMIServer.pm,
lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/ProducerConsumerServer.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
bin/pandora_server, util/pandora_db.pl, util/gpx2pandora_agent_data.pl,
util/pandora_manage.pl, util/pandora_dbstress.pl: Added the default library path
used by RPM and DEB packages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2755 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-05-19 18:59:00 +02:00
if ( ! - f $ archivo_cfg ) {
2008-02-25 19:00:09 +01:00
printf "\n [ERROR] Cannot open configuration file at $archivo_cfg. \n" ;
2018-05-25 12:39:30 +02:00
printf " Please specify a valid " . pandora_get_initial_product_name ( ) . " configuration file in command line. \n" ;
2009-12-14 00:38:31 +01:00
print " Standard configuration file is at /etc/pandora/pandora_server.conf \n" ;
2007-08-02 19:53:07 +02:00
exit 1 ;
}
2010-05-19 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Config.pm,
lib/PandoraFMS/Server.pm, lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/GIS.pm, lib/PandoraFMS/WMIServer.pm,
lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/ProducerConsumerServer.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
bin/pandora_server, util/pandora_db.pl, util/gpx2pandora_agent_data.pl,
util/pandora_manage.pl, util/pandora_dbstress.pl: Added the default library path
used by RPM and DEB packages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2755 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-05-19 18:59:00 +02:00
2007-08-02 19:53:07 +02:00
# Collect items from config file and put in an array
2018-11-22 12:29:25 +01:00
if ( ! open ( CFG , "<:encoding(UTF-8)" , $ archivo_cfg ) ) {
2010-05-19 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Config.pm,
lib/PandoraFMS/Server.pm, lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/GIS.pm, lib/PandoraFMS/WMIServer.pm,
lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/ProducerConsumerServer.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
bin/pandora_server, util/pandora_db.pl, util/gpx2pandora_agent_data.pl,
util/pandora_manage.pl, util/pandora_dbstress.pl: Added the default library path
used by RPM and DEB packages.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2755 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-05-19 18:59:00 +02:00
print "[ERROR] Error opening configuration file $archivo_cfg: $!.\n" ;
exit 1 ;
}
2007-08-02 19:53:07 +02:00
while ( <CFG> ) {
$ buffer_line = $ _ ;
if ( $ buffer_line =~ /^[a-zA-Z]/ ) { # begins with letters
if ( $ buffer_line =~ m/([\w\-\_\.]+)\s([0-9\w\-\_\.\/\?\&\=\)\(\_\-\!\*\@\#\%\$\~\"\']+)/ ) {
2008-02-20 03:09:36 +01:00
push @ command_line , $ buffer_line ;
2007-08-02 19:53:07 +02:00
}
}
}
close ( CFG ) ;
# Process this array with commandline like options
# Process input parameters
my @ args = @ command_line ;
my $ parametro ;
my $ ltotal = $# args ;
my $ ax ;
# Has read setup file ok ?
if ( $ ltotal == 0 ) {
2009-12-14 00:38:31 +01:00
print "[ERROR] No valid setup tokens readed in $archivo_cfg " ;
exit ;
2007-08-02 19:53:07 +02:00
}
for ( $ ax = 0 ; $ ax <= $ ltotal ; $ ax + + ) {
2009-12-14 00:38:31 +01:00
$ parametro = $ args [ $ ax ] ;
2008-11-09 15:42:13 +01:00
2009-12-14 00:38:31 +01:00
if ( $ parametro =~ m/^incomingdir\s(.*)/i ) {
2008-02-25 19:00:09 +01:00
$ tbuf = clean_blank ( $ 1 ) ;
2007-08-02 19:53:07 +02:00
if ( $ tbuf =~ m/^\.(.*)/ ) {
$ pa_config - > { "incomingdir" } = $ pa_config - > { "basepath" } . $ 1 ;
} else {
$ pa_config - > { "incomingdir" } = $ tbuf ;
}
}
2008-11-09 15:42:13 +01:00
2007-08-02 19:53:07 +02:00
elsif ( $ parametro =~ m/^log_file\s(.*)/i ) {
2008-11-09 15:42:13 +01:00
$ tbuf = clean_blank ( $ 1 ) ;
2007-08-02 19:53:07 +02:00
if ( $ tbuf =~ m/^\.(.*)/ ) {
2015-11-10 13:39:21 +01:00
$ pa_config - > { "log_file" } = $ pa_config - > { "basepath" } . $ 1 ;
2007-08-02 19:53:07 +02:00
} else {
2015-11-10 13:39:21 +01:00
$ pa_config - > { "log_file" } = $ tbuf ;
2007-08-02 19:53:07 +02:00
}
}
2008-11-09 15:42:13 +01:00
elsif ( $ parametro =~ m/^errorlog_file\s(.*)/i ) {
$ tbuf = clean_blank ( $ 1 ) ;
2007-08-02 19:53:07 +02:00
if ( $ tbuf =~ m/^\.(.*)/ ) {
2015-11-10 13:39:21 +01:00
$ pa_config - > { "errorlog_file" } = $ pa_config - > { "basepath" } . $ 1 ;
2007-08-02 19:53:07 +02:00
} else {
2015-11-10 13:39:21 +01:00
$ pa_config - > { "errorlog_file" } = $ tbuf ;
2007-08-02 19:53:07 +02:00
}
}
2008-06-13 18:42:35 +02:00
2009-12-14 00:38:31 +01:00
# MTA setup (2.0)
2009-01-24 16:41:39 +01:00
elsif ( $ parametro =~ m/^mta_user\s(.*)/i ) {
$ pa_config - > { 'mta_user' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^mta_pass\s(.*)/i ) {
$ pa_config - > { 'mta_pass' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^mta_address\s(.*)/i ) {
$ pa_config - > { 'mta_address' } = clean_blank ( $ 1 ) ;
2019-09-11 09:25:40 +02:00
$ pa_config - > { 'mta_local' } = 1 ;
2009-01-24 16:41:39 +01:00
}
elsif ( $ parametro =~ m/^mta_port\s(.*)/i ) {
$ pa_config - > { 'mta_port' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^mta_auth\s(.*)/i ) {
$ pa_config - > { 'mta_auth' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^mta_from\s(.*)/i ) {
2013-02-25 16:29:40 +01:00
$ pa_config - > { 'mta_from' } = clean_blank ( $ 1 ) ;
2009-01-24 16:41:39 +01:00
}
2019-09-10 15:53:47 +02:00
elsif ( $ parametro =~ m/^mta_encryption\s(.*)/i ) {
$ pa_config - > { 'mta_encryption' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^mail_in_separate\s+([0-9]*)/i ) {
2013-06-19 11:53:28 +02:00
$ pa_config - > { 'mail_in_separate' } = clean_blank ( $ 1 ) ;
}
2009-01-24 16:41:39 +01:00
elsif ( $ parametro =~ m/^snmp_logfile\s(.*)/i ) {
$ pa_config - > { 'snmp_logfile' } = clean_blank ( $ 1 ) ;
}
2012-02-20 18:47:08 +01:00
elsif ( $ parametro =~ m/^snmp_ignore_authfailure\s+([0-1])/i ) {
$ pa_config - > { 'snmp_ignore_authfailure' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^snmp_pdu_address\s+([0-1])/i ) {
$ pa_config - > { 'snmp_pdu_address' } = clean_blank ( $ 1 ) ;
2013-08-13 19:04:56 +02:00
}
elsif ( $ parametro =~ m/^snmp_storm_protection\s+(\d+)/i ) {
$ pa_config - > { 'snmp_storm_protection' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^snmp_storm_timeout\s+(\d+)/i ) {
$ pa_config - > { 'snmp_storm_timeout' } = clean_blank ( $ 1 ) ;
2012-02-20 18:47:08 +01:00
}
2016-08-09 12:11:37 +02:00
elsif ( $ parametro =~ m/^snmp_delay\s+(\d+)/i ) {
$ pa_config - > { 'snmp_delay' } = clean_blank ( $ 1 ) ;
}
2014-07-28 18:24:40 +02:00
elsif ( $ parametro =~ m/^snmpconsole_threads\s+(\d+)/i ) {
$ pa_config - > { 'snmpconsole_threads' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^translate_variable_bindings\s+([0-1])/i ) {
$ pa_config - > { 'translate_variable_bindings' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^translate_enterprise_strings\s+([0-1])/i ) {
$ pa_config - > { 'translate_enterprise_strings' } = clean_blank ( $ 1 ) ;
}
2016-10-28 19:22:07 +02:00
elsif ( $ parametro =~ m/^user\s(.*)/i ) {
$ pa_config - > { 'user' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^group\s(.*)/i ) {
$ pa_config - > { 'group' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^umask\s(.*)/i ) {
$ pa_config - > { 'umask' } = clean_blank ( $ 1 ) ;
}
2011-04-13 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/SNMPServer.pm,
lib/PandoraFMS/Config.pm,
lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/WMIServer.pm,
lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/DB.pm,
lib/PandoraFMS/ProducerConsumerServer.pm,
lib/PandoraFMS/PredictionServer.pm,
lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm,
bin/pandora_server,
util/pandora_db.pl,
util/pandora_manage.pl,
util/recon_scripts/snmpdevices.pl: Adding support for PostgreSQL and
Oracle (not complete).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4213 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-13 18:28:59 +02:00
elsif ( $ parametro =~ m/^dbengine\s(.*)/i ) {
$ pa_config - > { 'dbengine' } = clean_blank ( $ 1 ) ;
}
2008-02-25 19:00:09 +01:00
elsif ( $ parametro =~ m/^dbname\s(.*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'dbname' } = clean_blank ( $ 1 ) ;
}
2008-02-25 19:00:09 +01:00
elsif ( $ parametro =~ m/^dbuser\s(.*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'dbuser' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^dbpass\s(.*)/i ) {
$ pa_config - > { 'dbpass' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^dbhost\s(.*)/i ) {
$ pa_config - > { 'dbhost' } = clean_blank ( $ 1 ) ;
}
2012-04-20 05:56:09 +02:00
elsif ( $ parametro =~ m/^dbport\s(.*)/i ) {
$ pa_config - > { 'dbport' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^daemon\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'daemon' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^dataserver\s+([0-9]*)/i ) {
2008-02-25 19:00:09 +01:00
$ pa_config - > { 'dataserver' } = clean_blank ( $ 1 ) ;
2007-08-02 19:53:07 +02:00
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^networkserver\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'networkserver' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^pluginserver\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'pluginserver' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^predictionserver\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'predictionserver' } = clean_blank ( $ 1 ) ;
}
2019-02-21 15:07:51 +01:00
elsif ( $ parametro =~ m/^discoveryserver\s+([0-9]*)/i ) {
$ pa_config - > { 'discoveryserver' } = clean_blank ( $ 1 ) ;
2009-01-24 16:41:39 +01:00
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^reconserver\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'reconserver' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^wmiserver\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'wmiserver' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^exportserver\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'exportserver' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^inventoryserver\s+([0-9]*)/i ) {
2009-04-14 Ramon Novoa <rnovoa@artica.es>
* pandora_ctl, pandora_network, pandora_wmi, pandora_plugin,
pandora_prediction, bin/pandora_wmi, bin/pandora_plugin,
bin/pandora_prediction, bin/pandora_snmpconsole, bin/pandora_recon,
bin/pandora_network, pandora_recon, pandora_snmpconsole: Deleted
from repository. Old server code and startup scripts.
* Makefile.PL, pandora_server_installer, lib/PandoraFMS/Config.pm
lib/PandoraFMS/DB.pm, lib/PandoraFMS/Tools.pm, bin/pandora_server,
pandora_package_installer, pandora_server: Updated to work with the
new code, removed unneeded dependencies, fixed some bugs etc.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Added
to repository. New server code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1620 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-14 21:13:16 +02:00
$ pa_config - > { 'inventoryserver' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^webserver\s+([0-9]*)/i ) {
2009-04-14 Ramon Novoa <rnovoa@artica.es>
* pandora_ctl, pandora_network, pandora_wmi, pandora_plugin,
pandora_prediction, bin/pandora_wmi, bin/pandora_plugin,
bin/pandora_prediction, bin/pandora_snmpconsole, bin/pandora_recon,
bin/pandora_network, pandora_recon, pandora_snmpconsole: Deleted
from repository. Old server code and startup scripts.
* Makefile.PL, pandora_server_installer, lib/PandoraFMS/Config.pm
lib/PandoraFMS/DB.pm, lib/PandoraFMS/Tools.pm, bin/pandora_server,
pandora_package_installer, pandora_server: Updated to work with the
new code, removed unneeded dependencies, fixed some bugs etc.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Added
to repository. New server code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1620 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-14 21:13:16 +02:00
$ pa_config - > { 'webserver' } = clean_blank ( $ 1 ) ;
}
2017-05-05 12:54:55 +02:00
elsif ( $ parametro =~ m/^web_timeout\s+([0-9]*)/i ) {
$ pa_config - > { 'web_timeout' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^transactionalserver\s+([0-9]*)/i ) {
2016-06-13 13:51:55 +02:00
$ pa_config - > { 'transactionalserver' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^transactional_threads\s+([0-9]*)/i ) {
2016-06-13 13:51:55 +02:00
$ pa_config - > { 'transactional_threads' } = clean_blank ( $ 1 ) ;
}
2016-10-28 19:22:07 +02:00
elsif ( $ parametro =~ m/^transactional_threshold\s+([0-9]*\.{0,1}[0-9]*)/i ) {
2016-06-13 13:51:55 +02:00
$ pa_config - > { 'transactional_threshold' } = clean_blank ( $ 1 ) ;
}
if ( $ parametro =~ m/^transactional_pool\s(.*)/i ) {
$ tbuf = clean_blank ( $ 1 ) ;
if ( $ tbuf =~ m/^\.(.*)/ ) {
$ pa_config - > { "transactional_pool" } = $ pa_config - > { "incomingdir" } . "/" . $ 1 ;
} else {
$ pa_config - > { "transactional_pool" } = $ pa_config - > { "incomingdir" } . "/" . $ tbuf ;
}
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^eventserver\s+([0-9]*)/i ) {
2011-05-30 12:21:15 +02:00
$ pa_config - > { 'eventserver' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^icmpserver\s+([0-9]*)/i ) {
2011-06-20 18:32:29 +02:00
$ pa_config - > { 'icmpserver' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^icmp_threads\s+([0-9]*)/i ) {
2011-06-20 18:32:29 +02:00
$ pa_config - > { 'icmp_threads' } = clean_blank ( $ 1 ) ;
}
2009-01-24 16:41:39 +01:00
elsif ( $ parametro =~ m/^servername\s(.*)/i ) {
$ pa_config - > { 'servername' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^checksum\s+([0-9])/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "pandora_check" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^master\s+([0-9])/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "pandora_master" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^icmp_checks\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "icmp_checks" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^icmp_packets\s+([0-9]*)/i ) {
2015-03-18 16:21:39 +01:00
$ pa_config - > { "icmp_packets" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^snmpconsole\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "snmpconsole" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^snmpserver\s+([0-9]*)/i ) {
2011-07-27 18:07:12 +02:00
$ pa_config - > { "snmpserver" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^alert_recovery\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "alert_recovery" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^snmp_checks\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "snmp_checks" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^snmp_timeout\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "snmp_timeout" } = clean_blank ( $ 1 ) ;
}
2019-10-10 08:59:55 +02:00
elsif ( $ parametro =~ m/^rcmd_timeout\s+([0-9]*)/i ) {
$ pa_config - > { "rcmd_timeout" } = clean_blank ( $ 1 ) ;
}
2019-12-23 17:28:40 +01:00
elsif ( $ parametro =~ m/^rcmd_timeout_bin\s(.*)/i ) {
$ pa_config - > { "rcmd_timeout_bin" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^tcp_checks\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "tcp_checks" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^tcp_timeout\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "tcp_timeout" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^snmp_proc_deadresponse\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "snmp_proc_deadresponse" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^verbosity\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "verbosity" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^server_threshold\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "server_threshold" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^alert_threshold\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "alert_threshold" } = clean_blank ( $ 1 ) ;
}
2017-02-20 09:50:57 +01:00
elsif ( $ parametro =~ m/^graph_precision\s+([0-9]*)/i ) {
$ pa_config - > { "graph_precision" } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^network_timeout\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'networktimeout' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^network_threads\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'network_threads' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^plugin_threads\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'plugin_threads' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^prediction_threads\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'prediction_threads' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^plugin_timeout\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'plugin_timeout' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^dataserver_threads\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'dataserver_threads' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^server_keepalive\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { "keepalive" } = clean_blank ( $ 1 ) ;
$ pa_config - > { "keepalive_orig" } = clean_blank ( $ 1 ) ;
}
2009-08-19 21:49:55 +02:00
elsif ( $ parametro =~ m/^nmap\s(.*)/i ) {
$ pa_config - > { 'nmap' } = clean_blank ( $ 1 ) ;
}
2014-12-05 11:07:07 +01:00
elsif ( $ parametro =~ m/^fping\s(.*)/i ) {
$ pa_config - > { 'fping' } = clean_blank ( $ 1 ) ;
}
2019-11-21 18:21:46 +01:00
elsif ( $ parametro =~ m/^java\s(.*)/i ) {
$ pa_config - > { 'java' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^sap_utils\s(.*)/i ) {
$ pa_config - > { 'sap_utils' } = clean_blank ( $ 1 ) ;
}
2019-11-26 15:47:04 +01:00
elsif ( $ parametro =~ m/^sap_artica_test\s(.*)/i ) {
$ pa_config - > { 'sap_artica_test' } = clean_blank ( $ 1 ) ;
}
2019-12-19 11:48:20 +01:00
elsif ( $ parametro =~ m/^ssh_launcher\s(.*)/i ) {
$ pa_config - > { 'ssh_launcher' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^nmap_timing_template\s+([0-9]*)/i ) {
2014-08-07 12:43:25 +02:00
$ pa_config - > { 'nmap_timing_template' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^recon_timing_template\s+([0-9]*)/i ) {
2014-08-14 18:09:55 +02:00
$ pa_config - > { 'recon_timing_template' } = clean_blank ( $ 1 ) ;
}
2011-06-22 18:39:00 +02:00
elsif ( $ parametro =~ m/^braa\s(.*)/i ) {
$ pa_config - > { 'braa' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^braa_retries\s+([0-9]*)/i ) {
2013-03-20 16:50:41 +01:00
$ pa_config - > { "braa_retries" } = clean_blank ( $ 1 ) ;
}
2009-01-24 16:41:39 +01:00
elsif ( $ parametro =~ m/^xprobe2\s(.*)/i ) {
$ pa_config - > { 'xprobe2' } = clean_blank ( $ 1 ) ;
}
2019-09-24 19:07:55 +02:00
elsif ( $ parametro =~ m/^winexe\s(.*)/i ) {
$ pa_config - > { 'winexe' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^psexec\s(.*)/i ) {
$ pa_config - > { 'psexec' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^plink\s(.*)/i ) {
$ pa_config - > { 'plink' } = clean_blank ( $ 1 ) ;
}
2009-03-04 18:15:39 +01:00
elsif ( $ parametro =~ m/^snmpget\s(.*)/i ) {
$ pa_config - > { 'snmpget' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^autocreate\s+([0-9*]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'autocreate' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^autocreate_group\s+([0-9*]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'autocreate_group' } = clean_blank ( $ 1 ) ;
}
2019-07-25 13:00:40 +02:00
elsif ( $ parametro =~ m/^autocreate_group_force\s+([0-1])/i ) {
$ pa_config - > { 'autocreate_group_force' } = clean_blank ( $ 1 ) ;
}
2019-02-21 15:07:51 +01:00
elsif ( $ parametro =~ m/^discovery_threads\s+([0-9]*)/i ) {
$ pa_config - > { 'discovery_threads' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^recon_threads\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'recon_threads' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^max_log_size\s+([0-9]*)/i ) {
2009-01-24 16:41:39 +01:00
$ pa_config - > { 'max_log_size' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^max_log_generation\s+([1-9])/i ) {
2014-09-16 12:27:39 +02:00
$ pa_config - > { 'max_log_generation' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^wmi_threads\s+([0-9]*)/i ) {
2009-04-14 Ramon Novoa <rnovoa@artica.es>
* pandora_ctl, pandora_network, pandora_wmi, pandora_plugin,
pandora_prediction, bin/pandora_wmi, bin/pandora_plugin,
bin/pandora_prediction, bin/pandora_snmpconsole, bin/pandora_recon,
bin/pandora_network, pandora_recon, pandora_snmpconsole: Deleted
from repository. Old server code and startup scripts.
* Makefile.PL, pandora_server_installer, lib/PandoraFMS/Config.pm
lib/PandoraFMS/DB.pm, lib/PandoraFMS/Tools.pm, bin/pandora_server,
pandora_package_installer, pandora_server: Updated to work with the
new code, removed unneeded dependencies, fixed some bugs etc.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Added
to repository. New server code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1620 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-14 21:13:16 +02:00
$ pa_config - > { 'wmi_threads' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^wmi_client\s(.*)/i ) {
$ pa_config - > { 'wmi_client' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^web_threads\s+([0-9]*)/i ) {
2009-04-14 Ramon Novoa <rnovoa@artica.es>
* pandora_ctl, pandora_network, pandora_wmi, pandora_plugin,
pandora_prediction, bin/pandora_wmi, bin/pandora_plugin,
bin/pandora_prediction, bin/pandora_snmpconsole, bin/pandora_recon,
bin/pandora_network, pandora_recon, pandora_snmpconsole: Deleted
from repository. Old server code and startup scripts.
* Makefile.PL, pandora_server_installer, lib/PandoraFMS/Config.pm
lib/PandoraFMS/DB.pm, lib/PandoraFMS/Tools.pm, bin/pandora_server,
pandora_package_installer, pandora_server: Updated to work with the
new code, removed unneeded dependencies, fixed some bugs etc.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Added
to repository. New server code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1620 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-14 21:13:16 +02:00
$ pa_config - > { 'web_threads' } = clean_blank ( $ 1 ) ;
}
2013-11-11 16:17:26 +01:00
elsif ( $ parametro =~ m/^web_engine\s(.*)/i ) {
$ pa_config - > { 'web_engine' } = clean_blank ( $ 1 ) ;
}
2009-04-14 Ramon Novoa <rnovoa@artica.es>
* pandora_ctl, pandora_network, pandora_wmi, pandora_plugin,
pandora_prediction, bin/pandora_wmi, bin/pandora_plugin,
bin/pandora_prediction, bin/pandora_snmpconsole, bin/pandora_recon,
bin/pandora_network, pandora_recon, pandora_snmpconsole: Deleted
from repository. Old server code and startup scripts.
* Makefile.PL, pandora_server_installer, lib/PandoraFMS/Config.pm
lib/PandoraFMS/DB.pm, lib/PandoraFMS/Tools.pm, bin/pandora_server,
pandora_package_installer, pandora_server: Updated to work with the
new code, removed unneeded dependencies, fixed some bugs etc.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Added
to repository. New server code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1620 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-14 21:13:16 +02:00
elsif ( $ parametro =~ m/^snmp_trapd\s(.*)/i ) {
$ pa_config - > { 'snmp_trapd' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^plugin_exec\s(.*)/i ) {
$ pa_config - > { 'plugin_exec' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^inventory_threads\s+([0-9]*)/i ) {
2009-04-14 Ramon Novoa <rnovoa@artica.es>
* pandora_ctl, pandora_network, pandora_wmi, pandora_plugin,
pandora_prediction, bin/pandora_wmi, bin/pandora_plugin,
bin/pandora_prediction, bin/pandora_snmpconsole, bin/pandora_recon,
bin/pandora_network, pandora_recon, pandora_snmpconsole: Deleted
from repository. Old server code and startup scripts.
* Makefile.PL, pandora_server_installer, lib/PandoraFMS/Config.pm
lib/PandoraFMS/DB.pm, lib/PandoraFMS/Tools.pm, bin/pandora_server,
pandora_package_installer, pandora_server: Updated to work with the
new code, removed unneeded dependencies, fixed some bugs etc.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Added
to repository. New server code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1620 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-14 21:13:16 +02:00
$ pa_config - > { 'inventory_threads' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^export_threads\s+([0-9]*)/i ) {
2009-04-14 Ramon Novoa <rnovoa@artica.es>
* pandora_ctl, pandora_network, pandora_wmi, pandora_plugin,
pandora_prediction, bin/pandora_wmi, bin/pandora_plugin,
bin/pandora_prediction, bin/pandora_snmpconsole, bin/pandora_recon,
bin/pandora_network, pandora_recon, pandora_snmpconsole: Deleted
from repository. Old server code and startup scripts.
* Makefile.PL, pandora_server_installer, lib/PandoraFMS/Config.pm
lib/PandoraFMS/DB.pm, lib/PandoraFMS/Tools.pm, bin/pandora_server,
pandora_package_installer, pandora_server: Updated to work with the
new code, removed unneeded dependencies, fixed some bugs etc.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Added
to repository. New server code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1620 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-14 21:13:16 +02:00
$ pa_config - > { 'export_threads' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^max_queue_files\s+([0-9]*)/i ) {
2009-12-14 00:38:31 +01:00
$ pa_config - > { 'max_queue_files' } = clean_blank ( $ 1 ) ;
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^use_xml_timestamp\s+([0-1])/i ) {
2009-08-24 20:25:42 +02:00
$ pa_config - > { 'use_xml_timestamp' } = clean_blank ( $ 1 ) ;
}
2009-10-07 17:10:14 +02:00
elsif ( $ parametro =~ m/^restart_delay\s+(\d+)/i ) {
2009-12-14 00:38:31 +01:00
$ pa_config - > { 'restart_delay' } = clean_blank ( $ 1 ) ;
2009-10-07 17:10:14 +02:00
}
elsif ( $ parametro =~ m/^auto_restart\s+(\d+)/i ) {
2009-12-14 00:38:31 +01:00
$ pa_config - > { 'auto_restart' } = clean_blank ( $ 1 ) ;
2009-10-07 17:10:14 +02:00
}
2009-11-13 Ramon Novoa <rnovoa@artica.es>
* conf/pandora_server.conf: Updated configuration tokens.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Config.pm,
lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/PredictionServer.pm,
lib/PandoraFMS/Core.pm, lib/PandoraFMS/ReconServer.pm,
lib/PandoraFMS/DataServer.pm, lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/Tools.pm, lib/PandoraFMS/WMIServer.pm,
bin/pandora_server: Standardized and improved logging.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-11-13 14:52:48 +01:00
elsif ( $ parametro =~ m/^restart\s+([0-1])/i ) {
2009-12-14 00:38:31 +01:00
$ pa_config - > { 'restart' } = clean_blank ( $ 1 ) ;
2009-11-13 Ramon Novoa <rnovoa@artica.es>
* conf/pandora_server.conf: Updated configuration tokens.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Config.pm,
lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/PredictionServer.pm,
lib/PandoraFMS/Core.pm, lib/PandoraFMS/ReconServer.pm,
lib/PandoraFMS/DataServer.pm, lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/Tools.pm, lib/PandoraFMS/WMIServer.pm,
bin/pandora_server: Standardized and improved logging.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-11-13 14:52:48 +01:00
}
2011-03-14 11:39:31 +01:00
elsif ( $ parametro =~ m/^google_maps_description\s+([0-1])/i ) {
2011-03-09 14:49:30 +01:00
$ pa_config - > { 'google_maps_description' } = clean_blank ( $ 1 ) ;
2011-03-14 11:39:31 +01:00
}
2011-03-09 14:49:30 +01:00
elsif ( $ parametro =~ m/^openstreetmaps_description\s+([0-1])/i ) {
2011-03-14 11:39:31 +01:00
$ pa_config - > { 'openstreetmaps_description' } = clean_blank ( $ 1 ) ;
}
2010-01-25 19:36:23 +01:00
elsif ( $ parametro =~ m/^activate_gis\s+([0-1])/i ) {
$ pa_config - > { 'activate_gis' } = clean_blank ( $ 1 ) ;
}
2010-02-05 16:27:25 +01:00
elsif ( $ parametro =~ m/^location_error\s+(\d+)/i ) {
$ pa_config - > { 'location_error' } = clean_blank ( $ 1 ) ;
2010-02-15 21:34:57 +01:00
} #FIXME: Find a better regexp to validate the path
elsif ( $ parametro =~ m/^recon_reverse_geolocation_file\s+(.*)/i ) {
$ pa_config - > { 'recon_reverse_geolocation_file' } = clean_blank ( $ 1 ) ;
2018-07-05 15:01:23 +02:00
if ( ! - r $ pa_config - > { 'recon_reverse_geolocation_file' } ) {
print "[WARN] Invalid recon_reverse_geolocation_file.\n" ;
$ pa_config - > { 'recon_reverse_geolocation_file' } = '' ;
}
2010-02-15 21:34:57 +01:00
}
elsif ( $ parametro =~ m/^recon_location_scatter_radius\s+(\d+)/i ) {
$ pa_config - > { 'recon_location_scatter_radius' } = clean_blank ( $ 1 ) ;
}
2011-12-22 17:21:09 +01:00
elsif ( $ parametro =~ m/^self_monitoring\s+([0-1])/i ) {
2010-02-18 18:21:40 +01:00
$ pa_config - > { 'self_monitoring' } = clean_blank ( $ 1 ) ;
}
2014-10-15 15:06:57 +02:00
elsif ( $ parametro =~ m/^self_monitoring_interval\s+([0-9]*)/i ) {
$ pa_config - > { 'self_monitoring_interval' } = clean_blank ( $ 1 ) ;
}
2019-10-22 11:54:27 +02:00
elsif ( $ parametro =~ m/^sample_agent\s+([0-1])/i ) {
$ pa_config - > { 'sample_agent' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^sample_agent_interval\s+([0-9]*)/i ) {
$ pa_config - > { 'sample_agent_interval' } = clean_blank ( $ 1 ) ;
}
2011-12-22 17:21:09 +01:00
elsif ( $ parametro =~ m/^update_parent\s+([0-1])/i ) {
2010-02-25 18:09:19 +01:00
$ pa_config - > { 'update_parent' } = clean_blank ( $ 1 ) ;
}
2011-12-22 17:21:09 +01:00
elsif ( $ parametro =~ m/^event_window\s+([0-9]*)/i ) {
2011-05-30 12:21:15 +02:00
$ pa_config - > { 'event_window' } = clean_blank ( $ 1 ) ;
}
2019-11-19 11:56:11 +01:00
elsif ( $ parametro =~ m/^log_window\s+([0-9]*)/i ) {
$ pa_config - > { 'log_window' } = clean_blank ( $ 1 ) ;
}
2019-11-21 17:47:21 +01:00
elsif ( $ parametro =~ m/^preload_windows\s+([0-9]*)/i ) {
$ pa_config - > { 'preload_windows' } = clean_blank ( $ 1 ) ;
}
2011-12-22 17:21:09 +01:00
elsif ( $ parametro =~ m/^snmp_threads\s+([0-9]*)/i ) {
2011-08-22 12:13:34 +02:00
$ pa_config - > { 'snmp_threads' } = clean_blank ( $ 1 ) ;
}
2011-12-22 17:21:09 +01:00
elsif ( $ parametro =~ m/^block_size\s+([0-9]*)/i ) {
2011-06-20 18:32:29 +02:00
$ pa_config - > { 'block_size' } = clean_blank ( $ 1 ) ;
}
2012-10-24 11:38:08 +02:00
elsif ( $ parametro =~ m/^dataserver_lifo\s+([0-1])/i ) {
$ pa_config - > { 'dataserver_lifo' } = clean_blank ( $ 1 ) ;
}
2012-12-13 18:07:23 +01:00
elsif ( $ parametro =~ m/^policy_manager\s+([0-1])/i ) {
$ pa_config - > { 'policy_manager' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^event_replication\s+([0-1])/i ) {
$ pa_config - > { 'event_replication' } = clean_blank ( $ 1 ) ;
}
2013-01-31 19:02:41 +01:00
elsif ( $ parametro =~ m/^event_auto_validation\s+([0-1])/i ) {
$ pa_config - > { 'event_auto_validation' } = clean_blank ( $ 1 ) ;
}
2013-07-01 16:05:44 +02:00
elsif ( $ parametro =~ m/^event_file\s+(.*)/i ) {
$ pa_config - > { 'event_file' } = clean_blank ( $ 1 ) ;
}
2019-07-31 09:06:51 +02:00
elsif ( $ parametro =~ m/^event_inhibit_alerts\s+([0-1])/i ) {
$ pa_config - > { 'event_inhibit_alerts' } = clean_blank ( $ 1 ) ;
}
2013-09-04 15:28:13 +02:00
elsif ( $ parametro =~ m/^text_going_down_normal\s+(.*)/i ) {
$ pa_config - > { 'text_going_down_normal' } = safe_input ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^text_going_up_critical\s+(.*)/i ) {
$ pa_config - > { 'text_going_up_critical' } = safe_input ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^text_going_up_warning\s+(.*)/i ) {
$ pa_config - > { 'text_going_up_warning' } = safe_input ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^text_going_down_warning\s+(.*)/i ) {
$ pa_config - > { 'text_going_down_warning' } = safe_input ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^text_going_unknown\s+(.*)/i ) {
$ pa_config - > { 'text_going_unknown' } = safe_input ( $ 1 ) ;
}
2013-09-09 18:09:34 +02:00
elsif ( $ parametro =~ m/^event_expiry_time\s+([0-9]*)/i ) {
$ pa_config - > { 'event_expiry_time' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^event_expiry_window\s+([0-9]*)/i ) {
$ pa_config - > { 'event_expiry_window' } = clean_blank ( $ 1 ) ;
}
2013-11-07 17:23:44 +01:00
elsif ( $ parametro =~ m/^snmp_forward_trap\s+([0-1])/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'snmp_forward_trap' } = clean_blank ( $ 1 ) ;
2013-11-07 17:23:44 +01:00
}
elsif ( $ parametro =~ m/^snmp_forward_secName\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'snmp_forward_secName' } = safe_input ( clean_blank ( $ 1 ) ) ;
2013-11-07 17:23:44 +01:00
}
elsif ( $ parametro =~ m/^snmp_forward_engineid\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'snmp_forward_engineid' } = safe_input ( clean_blank ( $ 1 ) ) ;
2013-11-07 17:23:44 +01:00
}
elsif ( $ parametro =~ m/^snmp_forward_authProtocol\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'snmp_forward_authProtocol' } = safe_input ( clean_blank ( $ 1 ) ) ;
2013-11-07 17:23:44 +01:00
}
elsif ( $ parametro =~ m/^snmp_forward_authPassword\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'snmp_forward_authPassword' } = safe_input ( clean_blank ( $ 1 ) ) ;
2013-11-07 17:23:44 +01:00
}
elsif ( $ parametro =~ m/^snmp_forward_community\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'snmp_forward_community' } = safe_input ( clean_blank ( $ 1 ) ) ;
2013-11-07 17:23:44 +01:00
}
elsif ( $ parametro =~ m/^snmp_forward_privProtocol\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'snmp_forward_privProtocol' } = safe_input ( clean_blank ( $ 1 ) ) ;
2013-11-07 17:23:44 +01:00
}
elsif ( $ parametro =~ m/^snmp_forward_privPassword\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'snmp_forward_privPassword' } = safe_input ( clean_blank ( $ 1 ) ) ;
2013-11-07 17:23:44 +01:00
}
elsif ( $ parametro =~ m/^snmp_forward_secLevel\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'snmp_forward_secLevel' } = safe_input ( clean_blank ( $ 1 ) ) ;
2013-11-07 17:23:44 +01:00
}
elsif ( $ parametro =~ m/^snmp_forward_version\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'snmp_forward_version' } = safe_input ( clean_blank ( $ 1 ) ) ;
2013-11-07 17:23:44 +01:00
}
elsif ( $ parametro =~ m/^snmp_forward_ip\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'snmp_forward_ip' } = safe_input ( clean_blank ( $ 1 ) ) ;
2013-11-07 17:23:44 +01:00
if ( $ pa_config - > { 'snmp_forward_trap' } == 1 && ( $ pa_config - > { 'snmp_forward_ip' } eq '127.0.0.1' || $ pa_config - > { 'snmp_forward_ip' } eq 'localhost' ) ) {
printf "\n [ERROR] Cannot set snmp_forward_ip to localhost or 127.0.0.1 \n" ;
exit 1 ;
}
2014-05-30 14:26:40 +02:00
}
elsif ( $ parametro =~ m/^claim_back_snmp_modules\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'claim_back_snmp_modules' } = safe_input ( clean_blank ( $ 1 ) ) ;
2014-05-30 14:26:40 +02:00
}
2014-10-01 11:58:45 +02:00
elsif ( $ parametro =~ m/^async_recovery\s+([0-1])/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'async_recovery' } = clean_blank ( $ 1 ) ;
2014-10-01 11:58:45 +02:00
}
2015-02-09 17:47:34 +01:00
elsif ( $ parametro =~ m/^console_api_url\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'console_api_url' } = safe_input ( clean_blank ( $ 1 ) ) ;
2015-02-09 17:47:34 +01:00
}
elsif ( $ parametro =~ m/^console_api_pass\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'console_api_pass' } = safe_input ( clean_blank ( $ 1 ) ) ;
2015-02-09 17:47:34 +01:00
}
elsif ( $ parametro =~ m/^console_user\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'console_user' } = safe_input ( clean_blank ( $ 1 ) ) ;
2015-02-09 17:47:34 +01:00
}
elsif ( $ parametro =~ m/^console_pass\s(.*)/i ) {
2016-08-22 12:05:53 +02:00
$ pa_config - > { 'console_pass' } = safe_input ( clean_blank ( $ 1 ) ) ;
2015-02-09 17:47:34 +01:00
}
2015-03-09 16:11:05 +01:00
elsif ( $ parametro =~ m/^encryption_passphrase\s(.*)/i ) { # 6.0
2019-09-24 11:25:53 +02:00
$ pa_config - > { 'encryption_passphrase' } = clean_blank ( $ 1 ) ;
2015-03-02 17:29:14 +01:00
}
2016-08-22 12:05:53 +02:00
elsif ( $ parametro =~ m/^unknown_interval\s+([0-9]*)/i ) { # > 5.1SP2
$ pa_config - > { 'unknown_interval' } = clean_blank ( $ 1 ) ;
2015-03-09 16:11:05 +01:00
}
2015-09-30 15:15:50 +02:00
elsif ( $ parametro =~ m/^global_alert_timeout\s+([0-9]*)/i ) {
$ pa_config - > { 'global_alert_timeout' } = clean_blank ( $ 1 ) ;
}
2015-10-09 16:00:34 +02:00
elsif ( $ parametro =~ m/^remote_config\s+([0-9]*)/i ) {
$ pa_config - > { 'remote_config' } = clean_blank ( $ 1 ) ;
}
2015-10-15 11:51:09 +02:00
elsif ( $ parametro =~ m/^remote_config_address\s(.*)/i ) {
$ pa_config - > { 'remote_config_address' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^remote_config_port\s+([0-9]*)/i ) {
$ pa_config - > { 'remote_config_port' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^remote_config_opts\s(.*)/i ) {
$ pa_config - > { 'remote_config_opts' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^temporal\s(.*)/i ) {
$ pa_config - > { 'temporal' } = clean_blank ( $ 1 ) ;
}
2015-11-13 16:27:41 +01:00
elsif ( $ parametro =~ m/^warmup_event_interval\s+([0-9]*)/i ||
$ parametro =~ m/^warmup_alert_interval\s+([0-9]*)/i ) {
$ pa_config - > { 'warmup_event_interval' } = clean_blank ( $ 1 ) ;
$ pa_config - > { 'warmup_event_on' } = 1 if ( $ pa_config - > { 'warmup_event_interval' } > 0 ) ; # Off by default.
# The same interval is used for alerts and events.
$ pa_config - > { 'warmup_alert_interval' } = clean_blank ( $ 1 ) ;
$ pa_config - > { 'warmup_alert_on' } = 1 if ( $ pa_config - > { 'warmup_event_interval' } > 0 ) ; # Off by default.
}
elsif ( $ parametro =~ m/^warmup_unknown_interval\s+([0-9]*)/i ) {
$ pa_config - > { 'warmup_unknown_interval' } = clean_blank ( $ 1 ) ;
$ pa_config - > { 'warmup_unknown_on' } = 0 if ( $ pa_config - > { 'warmup_unknown_interval' } == 0 ) ; # On by default.
}
2016-08-17 09:12:45 +02:00
#elsif ($parametro =~ m/^include_agents\s+([0-1])/i) {
# $pa_config->{'include_agents'}= clean_blank($1);
#}
2016-11-15 11:28:52 +01:00
elsif ( $ parametro =~ m/^enc_dir\s+(.*)/i ) {
$ pa_config - > { 'enc_dir' } = clean_blank ( $ 1 ) ;
}
2016-11-29 09:11:00 +01:00
elsif ( $ parametro =~ m/^unknown_events\s+([0-1])/i ) {
$ pa_config - > { 'unknown_events' } = clean_blank ( $ 1 ) ;
}
2017-02-22 12:59:29 +01:00
elsif ( $ parametro =~ m/^syncserver\s+([0-9]*)/i ) {
$ pa_config - > { 'syncserver' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^sync_address\s+(.*)/i ) {
$ pa_config - > { 'sync_address' } = clean_blank ( $ 1 ) ;
}
2017-02-27 16:05:26 +01:00
elsif ( $ parametro =~ m/^sync_block_size\s+([0-9]*)/i ) {
$ pa_config - > { 'sync_block_size' } = clean_blank ( $ 1 ) ;
}
2017-02-24 08:19:02 +01:00
elsif ( $ parametro =~ m/^sync_ca\s+(.*)/i ) {
$ pa_config - > { 'sync_ca' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^sync_cert\s+(.*)/i ) {
$ pa_config - > { 'sync_cert' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^sync_key\s+(.*)/i ) {
$ pa_config - > { 'sync_key' } = clean_blank ( $ 1 ) ;
}
2017-02-22 12:59:29 +01:00
elsif ( $ parametro =~ m/^sync_port\s+([0-9]*)/i ) {
$ pa_config - > { 'sync_port' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^sync_timeout\s+([0-9]*)/i ) {
$ pa_config - > { 'sync_timeout' } = clean_blank ( $ 1 ) ;
}
2017-02-24 08:19:02 +01:00
elsif ( $ parametro =~ m/^sync_retries\s+([0-9]*)/i ) {
$ pa_config - > { 'sync_retries' } = clean_blank ( $ 1 ) ;
}
2017-03-01 14:58:20 +01:00
elsif ( $ parametro =~ m/^dynamic_updates\s+([0-9]*)/i ) {
$ pa_config - > { 'dynamic_updates' } = clean_blank ( $ 1 ) ;
}
2017-03-02 15:02:51 +01:00
elsif ( $ parametro =~ m/^dynamic_warning\s+([0-9]*)/i ) {
$ pa_config - > { 'dynamic_warning' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^dynamic_constant\s+([0-9]*)/i ) {
$ pa_config - > { 'dynamic_constant' } = clean_blank ( $ 1 ) ;
}
2017-09-05 10:00:24 +02:00
2017-08-25 17:03:26 +02:00
elsif ( $ parametro =~ m/^logstash_host\s+(.*)/i ) {
$ pa_config - > { 'logstash_host' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^logstash_port\s+([0-9]*)/i ) {
$ pa_config - > { 'logstash_port' } = clean_blank ( $ 1 ) ;
}
2017-08-23 09:35:17 +02:00
elsif ( $ parametro =~ m/^wuxserver\s+([0-1]*)/i ) {
$ pa_config - > { "wuxserver" } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^wux_host\s+(.*)/i ) {
$ pa_config - > { 'wux_host' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^wux_port\s+([0-9]*)/i ) {
$ pa_config - > { 'wux_port' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^wux_browser\s+(.*)/i ) {
$ pa_config - > { 'wux_browser' } = clean_blank ( $ 1 ) ;
}
2017-12-01 12:26:13 +01:00
elsif ( $ parametro =~ m/^wux_webagent_timeout\s+([0-9]*)/i ) {
$ pa_config - > { 'wux_webagent_timeout' } = clean_blank ( $ 1 ) ;
}
2020-04-22 16:09:12 +02:00
elsif ( $ parametro =~ m/^clean_wux_sessions\s+([0-9]*)/i ) {
$ pa_config - > { 'clean_wux_sessions' } = clean_blank ( $ 1 ) ;
}
2017-11-15 11:08:39 +01:00
elsif ( $ parametro =~ m/^syslogserver\s+([0-1])/i ) {
$ pa_config - > { 'syslogserver' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^syslog_file\s+(.*)/i ) {
$ pa_config - > { 'syslog_file' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^syslog_max\s+([0-9]*)/i ) {
$ pa_config - > { 'syslog_max' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^syslog_threads\s+([0-9]*)/i ) {
$ pa_config - > { 'syslog_threads' } = clean_blank ( $ 1 ) ;
}
2017-12-05 11:13:37 +01:00
elsif ( $ parametro =~ m/^thread_log\s+([0-1])/i ) {
$ pa_config - > { 'thread_log' } = clean_blank ( $ 1 ) ;
}
2018-01-11 16:00:22 +01:00
elsif ( $ parametro =~ m/^unknown_updates\s+([0-1])/i ) {
$ pa_config - > { 'unknown_updates' } = clean_blank ( $ 1 ) ;
}
2018-03-13 17:52:10 +01:00
elsif ( $ parametro =~ m/^provisioningserver\s+([0-1])/i ) {
$ pa_config - > { 'provisioningserver' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^provisioningserver_threads\s+([0-9]*)/i ) {
$ pa_config - > { 'provisioningserver_threads' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^provisioning_cache_interval\s+([0-9]*)/i ) {
$ pa_config - > { 'provisioning_cache_interval' } = clean_blank ( $ 1 ) ;
}
2018-07-04 18:39:06 +02:00
elsif ( $ parametro =~ m/^autoconfigure_agents\s+([0-1])/i ) {
$ pa_config - > { 'autoconfigure_agents' } = clean_blank ( $ 1 ) ;
}
2018-08-08 09:07:18 +02:00
elsif ( $ parametro =~ m/^snmp_extlog\s(.*)/i ) {
$ pa_config - > { 'snmp_extlog' } = clean_blank ( $ 1 ) ;
}
2019-01-14 15:16:36 +01:00
elsif ( $ parametro =~ m/^fsnmp\s(.*)/i ) {
$ pa_config - > { 'fsnmp' } = clean_blank ( $ 1 ) ;
}
2019-04-22 16:28:07 +02:00
# Pandora HA extra
elsif ( $ parametro =~ m/^ha_file\s(.*)/i ) {
$ pa_config - > { 'ha_file' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^ha_pid_file\s(.*)/i ) {
$ pa_config - > { 'ha_pid_file' } = clean_blank ( $ 1 ) ;
}
elsif ( $ parametro =~ m/^pandora_service_cmd\s(.*)/i ) {
$ pa_config - > { 'pandora_service_cmd' } = clean_blank ( $ 1 ) ;
}
2009-01-24 16:41:39 +01:00
} # end of loop for parameter #
2008-02-25 19:00:09 +01:00
2019-10-04 14:53:07 +02:00
# Generate the encryption key after reading the passphrase.
$ pa_config - > { "encryption_key" } = enterprise_hook ( 'pandora_get_encryption_key' , [ $ pa_config , $ pa_config - > { "encryption_passphrase" } ] ) ;
2012-04-20 05:56:09 +02:00
# Set to RDBMS' standard port
if ( ! defined ( $ pa_config - > { 'dbport' } ) ) {
if ( $ pa_config - > { 'dbengine' } eq "mysql" ) {
$ pa_config - > { 'dbport' } = 3306 ;
}
elsif ( $ pa_config - > { 'dbengine' } eq "postgresql" ) {
$ pa_config - > { 'dbport' } = 5432 ;
}
elsif ( $ pa_config - > { 'dbengine' } eq "oracle" ) {
$ pa_config - > { 'dbport' } = 1521 ;
}
}
2009-01-19 20:36:37 +01:00
if ( ( $ pa_config - > { "verbosity" } > 4 ) && ( $ pa_config - > { "quiet" } == 0 ) ) {
2009-01-24 16:41:39 +01:00
if ( $ pa_config - > { "PID" } ne "" ) {
print " [*] PID File is written at " . $ pa_config - > { 'PID' } . "\n" ;
}
2007-08-02 19:53:07 +02:00
print " [*] Server basepath is " . $ pa_config - > { 'basepath' } . "\n" ;
2015-11-10 13:39:21 +01:00
print " [*] Server logfile at " . $ pa_config - > { "log_file" } . "\n" ;
print " [*] Server errorlogfile at " . $ pa_config - > { "errorlog_file" } . "\n" ;
2007-08-02 19:53:07 +02:00
print " [*] Server incoming directory at " . $ pa_config - > { "incomingdir" } . "\n" ;
print " [*] Server keepalive " . $ pa_config - > { "keepalive" } . "\n" ;
print " [*] Server threshold " . $ pa_config - > { "server_threshold" } . "\n" ;
}
# Check for valid token token values
2015-11-10 13:39:21 +01:00
if ( ( $ pa_config - > { "dbuser" } eq "" ) || ( $ pa_config - > { "basepath" } eq "" ) || ( $ pa_config - > { "incomingdir" } eq "" ) || ( $ pa_config - > { "log_file" } eq "" ) || ( $ pa_config - > { "dbhost" } eq "" ) || ( $ pa_config - > { "pandora_master" } eq "" ) || ( $ pa_config - > { "dbpass" } eq "" ) ) {
2008-02-25 19:00:09 +01:00
print " [ERROR] Bad Config values. Be sure that $archivo_cfg is a valid setup file. \n\n" ;
2007-08-02 19:53:07 +02:00
exit ;
}
2009-12-14 00:38:31 +01:00
2009-01-24 16:41:39 +01:00
if ( ( $ pa_config - > { "quiet" } == 0 ) && ( $ pa_config - > { "verbosity" } > 4 ) ) {
if ( $ pa_config - > { "pandora_check" } == 1 ) {
print " [*] MD5 Security enabled.\n" ;
}
2015-01-13 10:54:19 +01:00
if ( $ pa_config - > { "pandora_master" } != 0 ) {
print " [*] This server is running with MASTER priority " . $ pa_config - > { "pandora_master" } . "\n" ;
2009-01-24 16:41:39 +01:00
}
}
2009-01-20 19:56:30 +01:00
2009-11-13 Ramon Novoa <rnovoa@artica.es>
* conf/pandora_server.conf: Updated configuration tokens.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/Config.pm,
lib/PandoraFMS/PluginServer.pm, lib/PandoraFMS/PredictionServer.pm,
lib/PandoraFMS/Core.pm, lib/PandoraFMS/ReconServer.pm,
lib/PandoraFMS/DataServer.pm, lib/PandoraFMS/NetworkServer.pm,
lib/PandoraFMS/Tools.pm, lib/PandoraFMS/WMIServer.pm,
bin/pandora_server: Standardized and improved logging.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-11-13 14:52:48 +01:00
logger ( $ pa_config , "Launching $pa_config->{'version'} $pa_config->{'build'}" , 1 ) ;
2015-11-10 13:39:21 +01:00
my $ config_options = "Logfile at " . $ pa_config - > { "log_file" } . ", Basepath is " . $ pa_config - > { "basepath" } . ", Checksum is " . $ pa_config - > { "pandora_check" } . ", Master is " . $ pa_config - > { "pandora_master" } . ", SNMP Console is " . $ pa_config - > { "snmpconsole" } . ", Server Threshold at " . $ pa_config - > { "server_threshold" } . " sec, verbosity at " . $ pa_config - > { "verbosity" } . ", Alert Threshold at $pa_config->{'alert_threshold'}, ServerName is '" . $ pa_config - > { 'servername' } . "'" ;
2008-03-13 19:33:44 +01:00
logger ( $ pa_config , "Config options: $config_options" , 1 ) ;
2007-08-02 19:53:07 +02:00
}
2008-03-13 19:33:44 +01:00
2012-01-24 18:16:56 +01:00
##########################################################################
# Open the log file and start logging.
##########################################################################
2009-04-14 Ramon Novoa <rnovoa@artica.es>
* pandora_ctl, pandora_network, pandora_wmi, pandora_plugin,
pandora_prediction, bin/pandora_wmi, bin/pandora_plugin,
bin/pandora_prediction, bin/pandora_snmpconsole, bin/pandora_recon,
bin/pandora_network, pandora_recon, pandora_snmpconsole: Deleted
from repository. Old server code and startup scripts.
* Makefile.PL, pandora_server_installer, lib/PandoraFMS/Config.pm
lib/PandoraFMS/DB.pm, lib/PandoraFMS/Tools.pm, bin/pandora_server,
pandora_package_installer, pandora_server: Updated to work with the
new code, removed unneeded dependencies, fixed some bugs etc.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Added
to repository. New server code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1620 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-14 21:13:16 +02:00
sub pandora_start_log ($) {
my $ pa_config = shift ;
2008-03-13 19:33:44 +01:00
2009-01-24 16:41:39 +01:00
# Dump all errors to errorlog
2018-05-25 12:39:30 +02:00
open ( STDERR , ">> " . $ pa_config - > { 'errorlog_file' } ) or die " [ERROR] " . pandora_get_initial_product_name ( ) . " can't write to Errorlog. Aborting : \n $! \n" ;
2017-05-29 10:34:42 +02:00
my $ mode = 0664 ;
chmod $ mode , $ pa_config - > { 'errorlog_file' } ;
2018-05-25 12:39:30 +02:00
print STDERR strftime ( "%Y-%m-%d %H:%M:%S" , localtime ( ) ) . ' - ' . $ pa_config - > { 'servername' } . " Starting " . pandora_get_initial_product_name ( ) . " Server. Error logging activated.\n" ;
2008-03-13 19:33:44 +01:00
}
2009-04-14 Ramon Novoa <rnovoa@artica.es>
* pandora_ctl, pandora_network, pandora_wmi, pandora_plugin,
pandora_prediction, bin/pandora_wmi, bin/pandora_plugin,
bin/pandora_prediction, bin/pandora_snmpconsole, bin/pandora_recon,
bin/pandora_network, pandora_recon, pandora_snmpconsole: Deleted
from repository. Old server code and startup scripts.
* Makefile.PL, pandora_server_installer, lib/PandoraFMS/Config.pm
lib/PandoraFMS/DB.pm, lib/PandoraFMS/Tools.pm, bin/pandora_server,
pandora_package_installer, pandora_server: Updated to work with the
new code, removed unneeded dependencies, fixed some bugs etc.
* lib/PandoraFMS/SNMPServer.pm, lib/PandoraFMS/PluginServer.pm,
lib/PandoraFMS/ProducerConsumerServer.pm, lib/PandoraFMS/Server.pm,
lib/PandoraFMS/PredictionServer.pm, lib/PandoraFMS/Core.pm,
lib/PandoraFMS/ReconServer.pm, lib/PandoraFMS/DataServer.pm,
lib/PandoraFMS/NetworkServer.pm, lib/PandoraFMS/WMIServer.pm: Added
to repository. New server code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1620 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-04-14 21:13:16 +02:00
2012-01-24 18:16:56 +01:00
##########################################################################
# Read the given token from the tconfig table.
##########################################################################
sub pandora_get_tconfig_token ($$$) {
my ( $ dbh , $ token , $ default_value ) = @ _ ;
my $ token_value = get_db_value ( $ dbh , "SELECT value FROM tconfig WHERE token = ?" , $ token ) ;
2019-04-11 15:36:55 +02:00
if ( defined ( $ token_value ) && $ token_value ne '' ) {
2012-01-24 18:16:56 +01:00
return safe_output ( $ token_value ) ;
}
return $ default_value ;
}
2018-05-25 12:39:30 +02:00
##########################################################################
# Get the product name in previous tasks to read from database.
##########################################################################
sub pandora_get_initial_product_name {
# PandoraFMS product name
my $ product_name = $ ENV { 'PANDORA_RB_PRODUCT_NAME' } ;
return 'Pandora FMS' unless ( defined ( $ product_name ) && $ product_name ne '' ) ;
return $ product_name ;
}
##########################################################################
# Get the copyright notice.
##########################################################################
sub pandora_get_initial_copyright_notice {
# PandoraFMS product name
my $ name = $ ENV { 'PANDORA_RB_COPYRIGHT_NOTICE' } ;
return 'Artica ST' unless ( defined ( $ name ) && $ name ne '' ) ;
return $ name ;
}
2007-08-02 19:53:07 +02:00
# End of function declaration
# End of defined Code
1 ;
__END__