mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: Use snmpv3 username even when NoAuthNoPriv is selected #4677
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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']."'";
|
||||
|
||||
Reference in New Issue
Block a user