Automating Host Group Management > Load Host Aliases
  
Version 10.0.01
Load Host Aliases
Description
Sets up host aliases from a comma-delimited file containing a list of hosts and host aliases.
Usage
execute load_package.loadHostAliasFile('<file_name>', '<log_path_name>','<log_file_name>');
Where file_name is the fully qualified path to the csv file that contains the aliases to be loaded.
Example of the file_name specification:
'/opt/aptare/database/HostAliases.csv'
Example of the command execution:
execute load_package.loadHostAliasFile('/opt/aptare/database HostAliases.csv', '/tmp','loadHostAlias.log');
Load File Specification
The specification for the comma-delimited file is as follows:
<domain>, <hostname>, <alias_hostname>
Example: Enterprise, whitney,182.16.1.101
The detailed specification for each field follows:
domain CHAR(128) NOT NULL
hostname CHAR(64) NOT NULL
alias_hostname CHAR(64)
The alias_hostname can be either a host name (up to 64 characters) or an IP address.
Data Constraints
Field values cannot contain embedded commas.
The second field, hostname, is the external name, as defined in the Portal database.
The csv file must exist and be readable.
The csv filename must be specified within single quotes.
Logic Conditions
If the host alias already exists, no updates take place.
If the host alias does not already exist in the Reporting Database, the utility adds it.
The utility applies case differences in the input file as updates to preexisting rows.
Logging
The utility logs all additions, updates, warnings and errors to the specified log file. Logging strings are typically in the format: Date -> Time -> load_package:sub_routine -> Action
sub_routine is the sub-routine that is being executed (e.g., loadHostLine).