mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-02 00:32:09 +02:00
when no snmp version is given on commandline, try v2c first, then v1
git-svn-id: http://www.observium.org/svn/observer/trunk@2991 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+14
-2
@@ -42,13 +42,25 @@ if (isset($argv[1]) && $argv[1])
|
|||||||
$transport = $argv[5];
|
$transport = $argv[5];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$snmpver) $snmpver = "v2c";
|
|
||||||
if ($community)
|
if ($community)
|
||||||
{
|
{
|
||||||
$config['snmp']['community'] = array($community);
|
$config['snmp']['community'] = array($community);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($snmpver)
|
||||||
|
{
|
||||||
|
$snmpversions[] = $snmpver;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$snmpversions = array('v2c','v1');
|
||||||
|
}
|
||||||
|
|
||||||
$device_id = addHost($host, $snmpver, $port, $transport);
|
while (!$device_id && count($snmpversions))
|
||||||
|
{
|
||||||
|
$snmpver = array_shift($snmpversions);
|
||||||
|
$device_id = addHost($host, $snmpver, $port, $transport);
|
||||||
|
}
|
||||||
|
|
||||||
if ($device_id)
|
if ($device_id)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user