Merge pull request #237 from bohdan-s/master

Support for Custom Default SMNP Port
This commit is contained in:
laf 2014-06-20 13:20:12 +01:00
commit 329e9fdd4d
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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