Make sure the alias is always set.
This commit is contained in:
parent
0daaa9651e
commit
e3205226e1
|
@ -374,8 +374,7 @@ sub process_xml_data ($$$$$) {
|
|||
|
||||
my $description = '';
|
||||
$description = $data->{'description'} if (defined ($data->{'description'}));
|
||||
my $alias = '';
|
||||
$alias = $data->{'agent_alias'} if (defined ($data->{'agent_alias'}));
|
||||
my $alias = (defined ($data->{'agent_alias'}) && $data->{'agent_alias'} ne '') ? $data->{'agent_alias'} : $data->{'agent_name'};
|
||||
|
||||
$agent_id = pandora_create_agent($pa_config, $pa_config->{'servername'}, $agent_name, $address, $group_id, $parent_id, $os,
|
||||
$description, $interval, $dbh, $timezone_offset, undef, undef, undef, undef, $custom_id, $url_address, $agent_mode, $alias);
|
||||
|
|
|
@ -936,6 +936,12 @@ sub pandora_checkdb_consistency {
|
|||
log_message ('CHECKDB',
|
||||
"Deleting non-existing module $id_agente_modulo in state table.");
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
# 3. Update empty aliases.
|
||||
#-------------------------------------------------------------------
|
||||
log_message ('CHECKDB', "Updating empty aliases.");
|
||||
db_do ($dbh, "UPDATE tagente SET alias=nombre WHERE alias=''");
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
|
|
Loading…
Reference in New Issue