From 17201a849d0c657b3fb22e566cf877ef53fa5354 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 14 Apr 2010 17:39:23 +0000 Subject: [PATCH] 2010-04-14 Ramon Novoa * lib/PandoraFMS/PredictionServer.pm: Added support for service modules (Enterprise) git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2566 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/PredictionServer.pm | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index c40127060e..f24b78bde7 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2010-04-14 Ramon Novoa + + * lib/PandoraFMS/PredictionServer.pm: Added support for service + modules (Enterprise). + 2010-04-05 Sancho Lerena * lib/PandoraFMS/ReconServer.pm: Trying to fix the problem detected diff --git a/pandora_server/lib/PandoraFMS/PredictionServer.pm b/pandora_server/lib/PandoraFMS/PredictionServer.pm index 096a47e957..0772bec18f 100644 --- a/pandora_server/lib/PandoraFMS/PredictionServer.pm +++ b/pandora_server/lib/PandoraFMS/PredictionServer.pm @@ -136,6 +136,13 @@ sub exec_prediction_module ($$$$) { my $agent_module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente_modulo = ?', $id_am); return unless defined $agent_module; + # Service modules + if ($agent_module->{'custom_integer_1'} != 0) { + logger ($pa_config, "Executing service module " . $agent_module->{'nombre'}, 10); + enterprise_hook ('exec_service_module', [$pa_config, $agent_module, $server_id, $dbh]); + return; + } + # Get a full hash for target agent_module record reference ($target_module) my $target_module = get_db_single_row ($dbh, 'SELECT * FROM tagente_modulo WHERE id_agente_modulo = ?', $agent_module->{'prediction_module'}); return unless defined $target_module;