diff --git a/AUTHORS.md b/AUTHORS.md index 66656de978..bcbd852999 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -135,6 +135,7 @@ LibreNMS contributors: - Florent Bruchez (ftbz) - Bartosz Radwan (bartoszradwan) - Kate Gerry (kate66) +- Johan Zaxmy (Zaxmy) - Ryan Gibbons (rtgibbons) [1]: http://observium.org/ "Observium web site" diff --git a/includes/snmp.inc.php b/includes/snmp.inc.php index 4f448707db..10e11d9110 100644 --- a/includes/snmp.inc.php +++ b/includes/snmp.inc.php @@ -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 = !empty($device['authname']) ? $device['authname'] : 'root'; + $cmd .= " -u '".$username."'"; } elseif ($device['authlevel'] === 'authNoPriv') { $cmd .= " -a '".$device['authalgo']."'"; $cmd .= " -A '".$device['authpass']."'";