diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 0474bc9bf0..5864990661 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,13 @@ +2013-09-12 Ramon Novoa + + * NetBSD/pandora_server.conf, + FreeBSD/pandora_server.conf, + conf/pandora_server.conf.new: Removed an unused token. + + * lib/PandoraFMS/DB.pm, + lib/PandoraFMS/Core.pm: Changed the module status macro to return a + string instead of the numeric value. + 2013-09-09 Ramon Novoa * conf/pandora_server.conf.new, diff --git a/pandora_server/FreeBSD/pandora_server.conf b/pandora_server/FreeBSD/pandora_server.conf index bb17649d7e..954f6eb41b 100644 --- a/pandora_server/FreeBSD/pandora_server.conf +++ b/pandora_server/FreeBSD/pandora_server.conf @@ -392,11 +392,6 @@ snmp_threads 2 block_size 15 -# Enable (1) or disable (0) Pandora FMS Netflow Server. -# You need to install package nfcapd before try to use this feature. - -netflowserver 1 - # Path to the netflow daemon nfcapd. netflow_daemon /usr/local/bin/nfcapd diff --git a/pandora_server/NetBSD/pandora_server.conf b/pandora_server/NetBSD/pandora_server.conf index 55c084859f..5fba4124c5 100644 --- a/pandora_server/NetBSD/pandora_server.conf +++ b/pandora_server/NetBSD/pandora_server.conf @@ -386,11 +386,6 @@ snmp_threads 2 block_size 15 -# Enable (1) or disable (0) Pandora FMS Netflow Server. -# You need to install package nfcapd before try to use this feature. - -netflowserver 1 - # If set to 1, process XML data files in a stack instead of a queue. 0 by default. # WARNING: Incremental modules will not work properly if dataserver_lifo is set to 1!!! diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index fa5e9f3909..653ebda877 100755 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -386,11 +386,6 @@ snmp_threads 2 block_size 15 -# Enable (1) or disable (0) Pandora FMS Netflow Server. -# You need to install package nfcapd before try to use this feature. - -netflowserver 1 - # If set to 1, process XML data files in a stack instead of a queue. 0 by default. # WARNING: Incremental modules will not work properly if dataserver_lifo is set to 1!!! diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 606a00a71f..f00ea97ac5 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -804,7 +804,7 @@ sub pandora_execute_action ($$$$$$$$$;$) { _module_ => (defined ($module)) ? $module->{'nombre'} : '', _modulegroup_ => (defined ($module)) ? (get_module_group_name ($dbh, $module->{'id_module_group'}) || '') : '', _moduledescription_ => (defined ($module)) ? $module->{'descripcion'} : '', - _modulestatus_ => (defined ($module)) ? get_agentmodule_status($pa_config, $dbh, $module->{'id_agente_modulo'}) : '', + _modulestatus_ => (defined ($module)) ? get_agentmodule_status_str($pa_config, $dbh, $module->{'id_agente_modulo'}) : '', _moduletags_ => (defined ($module)) ? pandora_get_module_tags ($pa_config, $dbh, $module->{'id_agente_modulo'}) : '', _id_agent_ => (defined ($module)) ? $module->{'id_agente'} : '', _id_alert_ => (defined ($alert->{'id_template_module'})) ? $alert->{'id_template_module'} : '', diff --git a/pandora_server/lib/PandoraFMS/DB.pm b/pandora_server/lib/PandoraFMS/DB.pm index 6ced243b2e..6fc77046e2 100644 --- a/pandora_server/lib/PandoraFMS/DB.pm +++ b/pandora_server/lib/PandoraFMS/DB.pm @@ -82,6 +82,7 @@ our @EXPORT = qw( get_agent_status get_agent_modules get_agentmodule_status + get_agentmodule_status_str get_agentmodule_data $RDBMS $RDBMS_QUOTE @@ -305,6 +306,24 @@ sub get_agentmodule_status($$$) { return $status; } +######################################################################## +## Return the status of an agent module as a string. +######################################################################## +sub get_agentmodule_status_str($$$) { + my ($pa_config, $dbh, $agent_module_id) = @_; + + my $status = get_db_value($dbh, 'SELECT estado + FROM tagente_estado + WHERE id_agente_modulo = ?', $agent_module_id); + + return 'Normal' if ($status == 0); + return 'Critical' if ($status == 1); + return 'Warning' if ($status == 2); + return 'Unknown' if ($status == 3); + return 'Not init' if ($status == 4); + return 'N/A'; +} + ######################################################################## ## SUB get_get_status (agent_id) ## Return agent status, given "agent_id"