From 93c187d0b9baf4a5618c64ac77357cbe0914c5a3 Mon Sep 17 00:00:00 2001 From: ramonn Date: Fri, 30 May 2014 12:26:40 +0000 Subject: [PATCH] 2014-05-30 Ramon Novoa * conf/pandora_server.conf.new, lib/PandoraFMS/Config.pm, util/pandora_db.pl: Added a new option to move SNMP modules back to the SNMP Enterprise Server. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10051 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 7 +++++++ pandora_server/conf/pandora_server.conf.new | 5 +++++ pandora_server/lib/PandoraFMS/Config.pm | 8 +++++++- pandora_server/util/pandora_db.pl | 4 +++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index de21430324..2e4f054b2d 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,10 @@ +2014-05-30 Ramon Novoa + + * conf/pandora_server.conf.new, + lib/PandoraFMS/Config.pm, + util/pandora_db.pl: Added a new option to move SNMP modules back to the + SNMP Enterprise Server. + 2014-05-30 Ramon Novoa * lib/PandoraFMS/Config.pm diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index f36bb337ad..96b55df014 100755 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -434,3 +434,8 @@ event_expiry_time 0 # be greater than event_expiry_time. #event_expiry_window 86400 +# If set to 1, SNMP modules run by the Network Server will be claimed back by +# the SNMP Enterprise Server when pandora_db is run. +claim_back_snmp_modules 1 + + diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 5e4161bb96..dcc1e42303 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -323,6 +323,9 @@ sub pandora_load_config { # Event auto-expiry time window $pa_config->{"event_expiry_window"} = 86400; # 5.0 + + # Event auto-expiry time window + $pa_config->{"claim_back_snmp_modules"} = 1; # 5.1 # ------------------------------------------------------------------------- # This values are not stored in .conf files. @@ -764,7 +767,10 @@ sub pandora_load_config { exit 1; } - } + } + elsif ($parametro =~ m/^claim_back_snmp_modules\s(.*)/i) { + $pa_config->{'claim_back_snmp_modules'}= safe_input($1); + } } # end of loop for parameter # # Set to RDBMS' standard port diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index c26bf368c8..d646a4308d 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -865,10 +865,12 @@ sub pandoradb_main ($$$) { } # Update tconfig with last time of database maintance time (now) - db_do ($dbh, "DELETE FROM tconfig WHERE token = 'db_maintance'"); db_do ($dbh, "INSERT INTO tconfig (token, value) VALUES ('db_maintance', '".time()."')"); + # Move SNMP modules back to the Enterprise server + enterprise_hook("claim_back_snmp_modules", [$dbh, $conf]); + log_message ('', "Ending at ". strftime ("%Y-%m-%d %H:%M:%S", localtime()) . "\n"); }