mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-23 18:08:49 +02:00
Merge branch '2031-syslogserver-perdida-de-historico-en-cambio-de-alias' into 'develop'
Added get_agent as unified function See merge request artica/pandorafms!1355
This commit is contained in:
commit
ff8051b433
@ -230,6 +230,7 @@ our @EXPORT = qw(
|
|||||||
pandora_self_monitoring
|
pandora_self_monitoring
|
||||||
pandora_process_policy_queue
|
pandora_process_policy_queue
|
||||||
subst_alert_macros
|
subst_alert_macros
|
||||||
|
get_agent
|
||||||
get_agent_from_alias
|
get_agent_from_alias
|
||||||
get_agent_from_addr
|
get_agent_from_addr
|
||||||
get_agent_from_name
|
get_agent_from_name
|
||||||
@ -254,6 +255,27 @@ our $EventStormProtection :shared = 0;
|
|||||||
# Current master server
|
# Current master server
|
||||||
my $Master :shared = 0;
|
my $Master :shared = 0;
|
||||||
|
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# Return the agent given the agent name or alias or address.
|
||||||
|
##########################################################################
|
||||||
|
sub get_agent {
|
||||||
|
my ($dbh, $field) = @_;
|
||||||
|
|
||||||
|
return undef if (! defined ($field) || $field eq '');
|
||||||
|
|
||||||
|
my $rs = get_agent_from_alias($dbh, $field);
|
||||||
|
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
|
||||||
|
|
||||||
|
my $rs = get_agent_from_addr($dbh, $field);
|
||||||
|
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
|
||||||
|
|
||||||
|
my $rs = get_agent_from_name($dbh, $field);
|
||||||
|
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
|
||||||
|
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# Return the agent given the agent name.
|
# Return the agent given the agent name.
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user