mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-04-08 18:55:09 +02:00
Merge branch '2078-ue-cmdb-integration' into 'develop'
2078 ue cmdb integration See merge request artica/pandorafms!1678
This commit is contained in:
commit
daf48c3798
@ -158,7 +158,7 @@ require Exporter;
|
||||
our @ISA = ("Exporter");
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw( ) ] );
|
||||
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
|
||||
our @EXPORT = qw(
|
||||
our @EXPORT = qw(
|
||||
pandora_add_agent_address
|
||||
pandora_audit
|
||||
pandora_create_agent
|
||||
@ -234,6 +234,7 @@ our @EXPORT = qw(
|
||||
pandora_self_monitoring
|
||||
pandora_process_policy_queue
|
||||
subst_alert_macros
|
||||
locate_agent
|
||||
get_agent
|
||||
get_agent_from_alias
|
||||
get_agent_from_addr
|
||||
@ -259,6 +260,32 @@ our $EventStormProtection :shared = 0;
|
||||
# Current master server
|
||||
my $Master :shared = 0;
|
||||
|
||||
##########################################################################
|
||||
# Return the agent given the agent name or alias or address.
|
||||
##########################################################################
|
||||
sub locate_agent {
|
||||
my ($pa_config, $dbh, $field) = @_;
|
||||
|
||||
if (is_metaconsole($pa_config)) {
|
||||
# Locate agent first in tmetaconsole_agent
|
||||
return undef if (! defined ($field) || $field eq '');
|
||||
|
||||
my $rs = enterprise_hook('get_metaconsole_agent_from_alias', [$dbh, $field]);
|
||||
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
|
||||
|
||||
$rs = enterprise_hook('get_metaconsole_agent_from_addr', [$dbh, $field]);
|
||||
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
|
||||
|
||||
$rs = enterprise_hook('get_metaconsole_agent_from_name', [$dbh, $field]);
|
||||
return $rs if defined($rs) && (ref($rs)); # defined and not a scalar
|
||||
|
||||
} else {
|
||||
return get_agent($dbh, $field);
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
##########################################################################
|
||||
# Return the agent given the agent name or alias or address.
|
||||
|
Loading…
x
Reference in New Issue
Block a user