Merge branch 'ent-3779-7612-Revision-de-llamadas-a-api-y-cli-agent-name-alias-name' into 'develop'

changed pandora api functions to include possibility of using agent alias when...

See merge request artica/pandorafms!2819
This commit is contained in:
Daniel Rodriguez 2019-10-28 11:25:38 +01:00
commit 08247c1952
4 changed files with 3394 additions and 1463 deletions

File diff suppressed because it is too large Load Diff

View File

@ -57,6 +57,7 @@ our @EXPORT = qw(
get_addr_id get_addr_id
get_agent_addr_id get_agent_addr_id
get_agent_id get_agent_id
get_agent_ids_from_alias
get_agent_address get_agent_address
get_agent_alias get_agent_alias
get_agent_group get_agent_group
@ -232,6 +233,17 @@ sub get_agent_id ($$) {
return defined ($rc) ? $rc : -1; return defined ($rc) ? $rc : -1;
} }
########################################################################
## Return agent IDs given an agent alias.
########################################################################
sub get_agent_ids_from_alias ($$) {
my ($dbh, $agent_alias) = @_;
my @rc = get_db_rows ($dbh, "SELECT id_agente, nombre FROM tagente WHERE alias = ?", safe_input($agent_alias));
return @rc;
}
######################################################################## ########################################################################
## Return server ID given the name of server. ## Return server ID given the name of server.
######################################################################## ########################################################################
@ -956,7 +968,7 @@ sub db_process_insert($$$$;@) {
} }
} }
my $columns_string = join(',', @columns_array); my $columns_string = join(',', @columns_array);
my $res = db_insert ($dbh, my $res = db_insert ($dbh,
$index, $index,
"INSERT INTO $table ($columns_string) VALUES " . $wildcards, @values_array); "INSERT INTO $table ($columns_string) VALUES " . $wildcards, @values_array);

View File

@ -141,6 +141,7 @@ our @EXPORT = qw(
long_to_ip long_to_ip
ip_to_long ip_to_long
get_enabled_servers get_enabled_servers
dateTimeToTimestamp
); );
# ID of the different servers # ID of the different servers

File diff suppressed because it is too large Load Diff