Modifications to accept spaces in agent alias CLI
This commit is contained in:
parent
e2550c22e3
commit
a85a7eccf8
|
@ -5389,6 +5389,8 @@ sub cli_get_agents_id_name_by_alias() {
|
||||||
my @agents;
|
my @agents;
|
||||||
my $where_value;
|
my $where_value;
|
||||||
|
|
||||||
|
$agent_alias =~ s/ / /g;
|
||||||
|
|
||||||
if($strict eq 'strict') {
|
if($strict eq 'strict') {
|
||||||
$where_value = $agent_alias;
|
$where_value = $agent_alias;
|
||||||
} else {
|
} else {
|
||||||
|
@ -5404,14 +5406,14 @@ sub cli_get_agents_id_name_by_alias() {
|
||||||
print "[ERROR] No agents retrieved.\n\n";
|
print "[ERROR] No agents retrieved.\n\n";
|
||||||
} else {
|
} else {
|
||||||
if(is_metaconsole($conf) == 1) {
|
if(is_metaconsole($conf) == 1) {
|
||||||
print "alias, id_agente, id_tagente, id_server, server_name\n";
|
print "id_agente, alias, id_tagente, id_server, server_name\n";
|
||||||
|
|
||||||
foreach my $agent (@agents) {
|
foreach my $agent (@agents) {
|
||||||
|
|
||||||
print safe_output($agent->{'alias'}).", ".$agent->{'id_agente'}.", ".$agent->{'id_tagente'}.", ".$agent->{'id_server'}.", ".$agent->{'server_name'}."\n";
|
print safe_output($agent->{'id_agente'}).", ".$agent->{'alias'}.", ".$agent->{'id_tagente'}.", ".$agent->{'id_server'}.", ".$agent->{'server_name'}."\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print "alias, id_agente\n";
|
print "id_agente, alias\n";
|
||||||
|
|
||||||
foreach my $agent (@agents) {
|
foreach my $agent (@agents) {
|
||||||
print $agent->{'id_agente'}.",".safe_output($agent->{'alias'})."\n";
|
print $agent->{'id_agente'}.",".safe_output($agent->{'alias'})."\n";
|
||||||
|
|
Loading…
Reference in New Issue