Make addhost work correctly again after transport patch, found by jwh

git-svn-id: http://www.observium.org/svn/observer/trunk@1864 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans 2011-03-16 01:05:02 +00:00
parent b07db6b09f
commit 0b55624ba0
2 changed files with 11 additions and 4 deletions

View File

@ -20,7 +20,14 @@ if (isset($argv[1]) && $argv[1])
$port = 161;
}
if (@!$argv[5])
{
$transport = 'udp';
}
else
{
$transport = $argv[5];
}
if (!$snmpver) $snmpver = "v2c";
if ($community)

View File

@ -498,10 +498,10 @@ function fixIOSHardware($hardware)
}
function createHost ($host, $community, $snmpver, $port = 161, $proto = 'udp')
function createHost ($host, $community, $snmpver, $port = 161, $transport = 'udp')
{
$host = trim(strtolower($host));
$device = deviceArray($host, $community, $snmpver, $port, $proto);
$device = deviceArray($host, $community, $snmpver, $port, $transport);
$host_os = getHostOS($device);
if ($host_os)