fixed to get stats version taking care depending of BIND version XML layout

This commit is contained in:
Jordi Sanfeliu 2013-09-12 16:32:20 +02:00
parent 9e95724631
commit f7df95dfe2
1 changed files with 8 additions and 1 deletions

View File

@ -259,7 +259,14 @@ sub bind_update {
my $data = XMLin($response->content);
my $value;
my ($major, $minor) = split('\.', $data->{bind}->{statistics}->{version});
# BIND v9.9+ has different statistics layout than BIND v9.5+
# attempt first to get stats from a BIND v9.9+
if(!($value = $data->{statistics}->{version})) {
# otherwise attempt it on a BIND v9.5+
$value = $data->{bind}->{statistics}->{version};
}
my ($major, $minor) = split('\.', $value);
$minor =~ m/^(\d+)/;
if(!grep {$_ eq $major} ("2", "3")) {
my $version = $major . "." . $minor;