fix: Use snmpv3 username even when NoAuthNoPriv is selected #4677

This commit is contained in:
Neil Lathwood
2016-10-03 18:32:28 +01:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -135,6 +135,7 @@ LibreNMS contributors:
- Florent Bruchez <ftbz@me.com> (ftbz)
- Bartosz Radwan <b.radwan@citypartner.pl> (bartoszradwan)
- Kate Gerry <kate@fansubber.com> (kate66)
- Johan Zaxmy <johan@zaxmy.com> (Zaxmy)
- Ryan Gibbons <rtgibbons23@gmail.com> (rtgibbons)
[1]: http://observium.org/ "Observium web site"
+2 -2
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 = !empty($device['authname']) ? $device['authname'] : 'root';
$cmd .= " -u '".$username."'";
} elseif ($device['authlevel'] === 'authNoPriv') {
$cmd .= " -a '".$device['authalgo']."'";
$cmd .= " -A '".$device['authpass']."'";