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:
parent
19fea4a864
commit
8830ccdaf3
|
@ -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.
|
||||
|
|
|
@ -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) = @_;
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue