Add IPv6 only host support

This commit is contained in:
bohdan-s
2014-06-21 08:02:27 -04:00
parent 5679241ca8
commit cb41d50094
2 changed files with 15 additions and 5 deletions
+3 -2
View File
@@ -261,7 +261,8 @@ function addHost($host, $snmpver, $port = '161', $transport = 'udp')
if (dbFetchCell("SELECT COUNT(*) FROM `devices` WHERE `hostname` = ?", array($host)) == '0')
{
// Test DNS lookup
if (gethostbyname($host) != $host)
//if (gethostbyname($host) != $host)
if (!(inet_pton($host)))
{
// Test reachability
if (isPingable($host))
@@ -350,7 +351,7 @@ function addHost($host, $snmpver, $port = '161', $transport = 'udp')
print_error("Could not ping $host"); }
} else {
// Failed DNS lookup
print_error("Could not resolve $host"); }
print_error("$host looks like an IP address, please use FQDN"); }
} else {
// found in database
print_error("Already got host $host");