mirror of
https://github.com/librenms/librenms.git
synced 2024-09-29 22:36:40 +00:00
Merge pull request #237 from bohdan-s/master
Support for Custom Default SMNP Port
This commit is contained in:
commit
329e9fdd4d
@ -23,7 +23,7 @@ if ($_POST['hostname'])
|
||||
}
|
||||
|
||||
$snmpver = mres($_POST['snmpver']);
|
||||
if ($_POST['port']) { $port = mres($_POST['port']); } else { $port = "161"; }
|
||||
if ($_POST['port']) { $port = mres($_POST['port']); } else { $port = $config['snmp']['port']; }
|
||||
print_message("Adding host $hostname communit" . (count($config['snmp']['community']) == 1 ? "y" : "ies") . " " . implode(', ',$config['snmp']['community']) . " port $port");
|
||||
}
|
||||
elseif ($_POST['snmpver'] === "v3")
|
||||
@ -41,7 +41,7 @@ if ($_POST['hostname'])
|
||||
|
||||
$snmpver = "v3";
|
||||
|
||||
if ($_POST['port']) { $port = mres($_POST['port']); } else { $port = "161"; }
|
||||
if ($_POST['port']) { $port = mres($_POST['port']); } else { $port = $config['snmp']['port']; }
|
||||
print_message("Adding SNMPv3 host $hostname port $port");
|
||||
}
|
||||
else
|
||||
|
@ -141,6 +141,7 @@ $config['snmp']['version'] = "v2c"; # Default version to use
|
||||
|
||||
# SNMPv1/2c default settings
|
||||
$config['snmp']['community'][0] = "public"; # Communities to try during adding hosts and discovery
|
||||
$config['snmp']['port'] = 161; # Port Client SNMP is running on
|
||||
|
||||
# SNMPv3 default settings
|
||||
# The array can be expanded to give another set of parameters
|
||||
|
Loading…
Reference in New Issue
Block a user