지금 말씀하신 내용들은 적용하신 fixpack하고도 밀접한 관계가 있습니다.
다음은 유사한 문제를 문의하셨던 분께 드렸던 답변입니다.
ITM의 Hostname과 관련하여 >>>
- ITM 5.1.1 FP05이후 부터 ITM_DB의 ENDPOINTS내부의 HOST_NAME 필드는 XML 파일에서 수집된 hostname을 그대로 사용합니다.
- XML에서 수집하는 hostname은 endpoint의 lcf.dat에 저장된 IP를 기반으로 gethostbyaddr() system call을 사용합니다. 이로서 수집된 값을 XML파일의 hostname에 사용합니다.
- 이 hostname과 epLabel, 그리고 IPaddress필드를 조합하여 ENDPOINTS 테이블의 primary key로 사용합니다.
- 현재까지 ITM은 gethostbyaddr()로 변경되는 것에 대해 조절할 수 있는 기능은 없습니다. 만약 DNS를 사용하는 경우에 DNS가 down되고 /etc/nsswitch.conf(SUN&HP) /etc/netsvc.con(AIX)에 기술된 검색순서로 /etc/hosts로부터 hostname을 가져오는데 DNS로부터의 값과 다른 경우엔, ITM은 이를 새로운 장비로부터의 데이터로 인식하고 새로운 primary key를 생성하게 됩니다.
- ITM에서 가져오는 정확한 호스트명을 검증하는 방법은 get_dns_info.pl을 이용하는 것입니다.
- 마지막으로 5.1.2-ITM-FP04의 IY63101 defect를 fix한 내용에 API가 항상 Fully Qualified Host Name을 반환하지 않는 부분에 대한 fix가 들어 있습니다. 따라서 이 fix로 인해 hostname을 call하는 API가 변경되면 다른 value의 hostname을 가져오게 됩니다.
참조
<get_dns_info.pl>
#!/etc/Tivoli/bin/perl -w
- get-dns-info v1.0
- 971230
- dmclaren@tivoli.com
#
- This script is meant to be a replacement for the
- get_host_by_addr.pl and get_host_by_name.pl scripts - it does the same
- things, but 1) does it in one script instead of two 2) gives a little
- more information and 3) will dig recursively for even more information,
- unless given the -n option.
#
- Input: any number of hostnames or IPs on the command line.
- Output: what the local name services thinks about each hostname/ip.
#
- if the -n option isn't given, it will do lookups on everything returned
- by the lookups of everything given on the command line.
- For most OS's, $af_inet should be set to 2.
- I seem to recall at least one OS where it needed to be 1, but I can't
- remember what it was now.
$af_inet = 2 ;
print "\n" ;
if (! @ARGV) {
die "Usage: $0 ip/hostname#1
ip/hostname#2 etc\n" ;
}
if ($ARGV[0] =~ /^^-n/) {
$recursive = 0 ;
shift (@ARGV) ;
} else {
$recursive = 1 ;
}
- This is the queue of lookups yet to do.
@queue = @ARGV ;
- This is a list of lookups already done - don't do them twice.
undef %lookups_done ;
while ($input = shift(@queue)) {
# Skip duplicates.
if ($lookups_done{$input}) {
next ;
} else {
$lookups_done{$input} = 1 ;
}
# Skip null entries.
next if ($input =~ /^^$|^^<none>$/) ;
if ($input =~ /
^^A-Za-z\d\-\./) {
print "`$input' contains characters not legal for a hostname.\n" ;
} elsif ($input =~ /^^\d+\.\d+\.\d+\.\d+$/) {
&check_ip_address($input) ;
} else {
# Ok, it's not an IP address. Assume it's a hostname.
&check_hostname($input) ;
}
print "\n" ;
}
sub check_ip_address {
local ($name, $aliases, $addrtype, $length, @addrs, $address, @ips) ;
$address = pack("c4", split(/[.]/, $_[0])) ;
undef $name ;
undef $aliases ;
undef $addrtype ;
undef $length ;
undef @addrs ;
($name, $aliases, $addrtype, $length, @addrs) =
gethostbyaddr ($address, $af_inet);
$name = "<none>" if (! $name) ;
$aliases = "<none>" if (! $aliases) ;
@ips = () ;
if ($#addrs >= 0) {
for (0..$#addrs) {
@ips = (@ips, join (".", unpack('C4', $addrs
$_))) ;
}
}
print " gethostbyaddr() on `$_[0]' : \n" ;
print " name = $name\n" ;
print " aliases = $aliases\n" ;
print " addrs = @ips\n" ;
if ($recursive) {
&add_to_queue($name, split (/\s/, $aliases), @ips) ;
}
}
sub check_hostname {
local ($name, $aliases, $addrtype, $length, @addrs, @ips) ;
undef $name ;
undef $aliases ;
undef $addrtype ;
undef $length ;
undef @addrs ;
($name, $aliases, $addrtype, $length, @addrs) = gethostbyname($_[0]) ;
$name = "<none>" if (! $name) ;
$aliases = "<none>" if (! $aliases) ;
@ips = () ;
if ($#addrs >= 0) {
for (0..$#addrs) {
@ips = (@ips, join (".", unpack('C4', $addrs
$_))) ;
}
}
print " gethostbyname() on `$_[0]' : \n" ;
print " name = $name\n" ;
print " aliases = $aliases\n" ;
print " addrs = @ips\n" ;
if ($recursive) {
&add_to_queue($name, split (/\s/, $aliases), @ips) ;
}
}
- add entries to the `todo' queue, at the beginning.
- This is so simple it really doesn't need a subroutine.
sub add_to_queue {
@queue = (@_, @queue) ;
}
Message was edited by: kr_admin