fix host adding (oopsie)

git-svn-id: http://www.observium.org/svn/observer/trunk@2439 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-09-08 17:09:36 +00:00
parent 1ea2dc9ceb
commit a4fcf7d252
2 changed files with 2 additions and 3 deletions

View File

@@ -3,7 +3,6 @@
if (!$os) if (!$os)
{ {
if (strstr($sysObjectId, ".1.3.6.1.4.1.388")) { $os = "symbol"; } if (strstr($sysObjectId, ".1.3.6.1.4.1.388")) { $os = "symbol"; }
echo "symbol";
} }
?> ?>

View File

@@ -184,10 +184,10 @@ function addHost($host, $community, $snmpver, $port = '161', $transport = 'udp')
if (dbFetchCell("SELECT COUNT(*) FROM `devices` WHERE `hostname` = ?", array($host)) == '0') if (dbFetchCell("SELECT COUNT(*) FROM `devices` WHERE `hostname` = ?", array($host)) == '0')
{ {
/// Test DNS lookup /// Test DNS lookup
if (isDomainResolves($argv[1])) if (gethostbyname($host) != $host)
{ {
/// Test reachability /// Test reachability
if (isPingable($argv[1])) if (isPingable($host))
{ {
$added = 0; $added = 0;
/// try each community from config /// try each community from config