2011-05-12 Sergio Martin <sergio.martin@artica.es>

* lib/PandoraFMS/DB.pm: Added a function to give the address of
	one agent



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4342 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2011-05-12 11:11:37 +00:00
parent f817a4f400
commit dda7b55d58
2 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-05-12 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/DB.pm: Added a function to give the address of
one agent
2011-05-12 Sergio Martin <sergio.martin@artica.es>
* util/pandora_manage.pl: Change apply policy option in CLI to

View File

@ -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"