mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix to actually make community parameter optional again
git-svn-id: http://www.observium.org/svn/observer/trunk@1874 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -30,14 +30,13 @@ if (isset($argv[1]) && $argv[1])
|
||||
}
|
||||
|
||||
if (!$snmpver) $snmpver = "v2c";
|
||||
|
||||
if ($community)
|
||||
{
|
||||
unset($config['snmp']['community']);
|
||||
$config['snmp']['community'][] = $community;
|
||||
}
|
||||
|
||||
$device = deviceArray($host, $community, $snmpver, $port, $transport);
|
||||
|
||||
list($hostshort) = explode(".", $host);
|
||||
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `devices` WHERE `hostname` = '".mres($host)."'"), 0) == '0' )
|
||||
{
|
||||
@@ -47,6 +46,9 @@ if (isset($argv[1]) && $argv[1])
|
||||
{
|
||||
# FIXME should be a foreach $config['snmp']['community'][0] as $community
|
||||
$community = $config['snmp']['community'][0];
|
||||
|
||||
$device = deviceArray($host, $community, $snmpver, $port, $transport);
|
||||
|
||||
if (isSNMPable($device))
|
||||
{
|
||||
$snmphost = snmp_get($device, "sysName.0", "-Oqv", "SNMPv2-MIB");
|
||||
|
Reference in New Issue
Block a user