2011-06-10 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/DB.pm: Added a function to get the group of an agent.

	* lib/PandoraFMS/Core.pm: Fixed a prototype.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4431 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2011-06-10 12:50:56 +00:00
parent 19fea4a864
commit 8830ccdaf3
3 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2011-06-10 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/DB.pm: Added a function to get the group of an agent.
* lib/PandoraFMS/Core.pm: Fixed a prototype.
2011-06-08 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Use commas to separate tags.

View File

@ -1420,7 +1420,7 @@ Generate an event.
=cut
##########################################################################
sub pandora_event ($$$$$$$$$$;$) {
sub pandora_event ($$$$$$$$$$) {
my ($pa_config, $evento, $id_grupo, $id_agente, $severity,
$id_alert_am, $id_agentmodule, $event_type, $event_status, $dbh) = @_;

View File

@ -41,6 +41,7 @@ our @EXPORT = qw(
get_action_id
get_agent_id
get_agent_address
get_agent_group
get_agent_name
get_agent_module_id
get_alert_template_module_id
@ -170,6 +171,19 @@ sub get_os_id ($$) {
return defined ($rc) ? $rc : -1;
}
##########################################################################
## SUB get_agent_name (agent_id)
## Return agent group id, given "agent_id"
##########################################################################
sub get_agent_group ($$) {
my ($dbh, $agent_id) = @_;
my $group_id = get_db_value ($dbh, "SELECT id_grupo FROM tagente WHERE id_agente = ?", $agent_id);
return 0 unless defined ($group_id);
return $group_id;
}
##########################################################################
## SUB get_agent_name (agent_id)
## Return agent name, given "agent_id"