mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Pass snmp-auth parameters enclosed by single-quotes
This commit is contained in:
@@ -748,7 +748,7 @@ function snmp_gen_auth(&$device) {
|
|||||||
$cmd = '';
|
$cmd = '';
|
||||||
|
|
||||||
if ($device['snmpver'] === 'v3') {
|
if ($device['snmpver'] === 'v3') {
|
||||||
$cmd = ' -v3 -n "" -l '.$device['authlevel'];
|
$cmd = " -v3 -n '' -l '".$device['authlevel']."'";
|
||||||
|
|
||||||
if ($device['authlevel'] === 'noAuthNoPriv') {
|
if ($device['authlevel'] === 'noAuthNoPriv') {
|
||||||
// We have to provide a username anyway (see Net-SNMP doc)
|
// We have to provide a username anyway (see Net-SNMP doc)
|
||||||
@@ -756,16 +756,16 @@ function snmp_gen_auth(&$device) {
|
|||||||
$cmd .= ' -u root';
|
$cmd .= ' -u root';
|
||||||
}
|
}
|
||||||
else if ($device['authlevel'] === 'authNoPriv') {
|
else if ($device['authlevel'] === 'authNoPriv') {
|
||||||
$cmd .= ' -a '.$device['authalgo'];
|
$cmd .= " -a '".$device['authalgo']."'";
|
||||||
$cmd .= ' -A "'.$device['authpass'].'"';
|
$cmd .= " -A '".$device['authpass']."'";
|
||||||
$cmd .= ' -u '.$device['authname'];
|
$cmd .= " -u '".$device['authname']."'";
|
||||||
}
|
}
|
||||||
else if ($device['authlevel'] === 'authPriv') {
|
else if ($device['authlevel'] === 'authPriv') {
|
||||||
$cmd .= ' -a '.$device['authalgo'];
|
$cmd .= " -a '".$device['authalgo']."'";
|
||||||
$cmd .= ' -A "'.$device['authpass'].'"';
|
$cmd .= " -A '".$device['authpass']."'";
|
||||||
$cmd .= ' -u '.$device['authname'];
|
$cmd .= " -u '".$device['authname']."'";
|
||||||
$cmd .= ' -x '.$device['cryptoalgo'];
|
$cmd .= " -x '".$device['cryptoalgo']."'";
|
||||||
$cmd .= ' -X "'.$device['cryptopass'].'"';
|
$cmd .= " -X '".$device['cryptopass']."'";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
|
|||||||
Reference in New Issue
Block a user