diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 8c5b8ed969..ea6b8951ea 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2011-05-12 Sergio Martin + + * lib/PandoraFMS/DB.pm: Added a function to give the address of + one agent + 2011-05-12 Sergio Martin * util/pandora_manage.pl: Change apply policy option in CLI to diff --git a/pandora_server/lib/PandoraFMS/DB.pm b/pandora_server/lib/PandoraFMS/DB.pm index a2f8b6b4a0..941f322ad6 100644 --- a/pandora_server/lib/PandoraFMS/DB.pm +++ b/pandora_server/lib/PandoraFMS/DB.pm @@ -40,6 +40,7 @@ our @EXPORT = qw( db_update get_action_id get_agent_id + get_agent_address get_agent_name get_agent_module_id get_alert_template_module_id @@ -168,8 +169,8 @@ sub get_os_id ($$) { } ########################################################################## -## SUB dame_agente_nombre (id_agente) -## Return agent name, given "id_agente" +## SUB get_agent_name (agent_id) +## Return agent name, given "agent_id" ########################################################################## sub get_agent_name ($$) { my ($dbh, $agent_id) = @_; @@ -177,6 +178,16 @@ sub get_agent_name ($$) { return get_db_value ($dbh, "SELECT nombre FROM tagente WHERE id_agente = ?", $agent_id); } +########################################################################## +## SUB get_agent_address (id_agente) +## Return agent address, given "agent_id" +########################################################################## +sub get_agent_address ($$) { + my ($dbh, $agent_id) = @_; + + return get_db_value ($dbh, "SELECT direccion FROM tagente WHERE id_agente = ?", $agent_id); +} + ########################################################################## ## SUB get_module_name(module_id) ## Return the module name, given "module_id"