Fixes issue-4677

This commit is contained in:
Johan
2016-09-30 15:08:11 +02:00
parent 76a3b9b87e
commit 032bfe0745

View File

@@ -560,8 +560,8 @@ function snmp_gen_auth(&$device)
if ($device['authlevel'] === 'noAuthNoPriv') {
// We have to provide a username anyway (see Net-SNMP doc)
// FIXME: There are two other places this is set - why are they ignored here?
$cmd .= ' -u root';
$username = isset($device['authname']) ? $device['authname'] : 'root';
$cmd .= " -u '".$username."'";
} elseif ($device['authlevel'] === 'authNoPriv') {
$cmd .= " -a '".$device['authalgo']."'";
$cmd .= " -A '".$device['authpass']."'";