diff --git a/html/pages/device/edit/snmp.inc.php b/html/pages/device/edit/snmp.inc.php index d3af2ac0d2..0634a778f6 100644 --- a/html/pages/device/edit/snmp.inc.php +++ b/html/pages/device/edit/snmp.inc.php @@ -10,6 +10,7 @@ if ($_POST['editing']) { $retries = mres($_POST['retries']); $poller_group = mres($_POST['poller_group']); $port_assoc_mode = mres($_POST['port_assoc_mode']); + $max_repeaters = mres($_POST['max_repeaters']); $v3 = array( 'authlevel' => mres($_POST['authlevel']), 'authname' => mres($_POST['authname']), @@ -48,13 +49,29 @@ if ($_POST['editing']) { $device_tmp = deviceArray($device['hostname'], $community, $snmpver, $port, $transport, $v3, $port_assoc_mode); if (isSNMPable($device_tmp)) { $rows_updated = dbUpdate($update, 'devices', '`device_id` = ?', array($device['device_id'])); + + $max_repeaters_set = false; + + if (is_numeric($max_repeaters) && $max_repeaters != 0) { + set_dev_attrib($device, 'snmp_max_repeaters', $max_repeaters); + $max_repeaters_set = true; + } + else { + del_dev_attrib($device, 'snmp_max_repeaters'); + $max_repeaters_set = true; + } if ($rows_updated > 0) { $update_message = $rows_updated.' Device record updated.'; $updated = 1; } else if ($rows_updated = '-1') { - $update_message = 'Device record unchanged. No update necessary.'; + if ($max_repeaters_set === true) { + $update_message = 'SNMP Max repeaters updated, no other changes made'; + } + else { + $update_message = 'Device record unchanged. No update necessary.'; + } $updated = -1; } else { @@ -79,6 +96,8 @@ else if ($update_message) { print_error($update_message); } +$max_repeaters = get_dev_attrib($device, 'snmp_max_repeaters'); + echo "