Merge pull request #1730 from f0o/issue-1728

This commit is contained in:
Neil Lathwood
2015-08-20 20:32:58 +01:00
+9 -9
View File
@@ -748,7 +748,7 @@ function snmp_gen_auth(&$device) {
$cmd = '';
if ($device['snmpver'] === 'v3') {
$cmd = ' -v3 -n "" -l '.$device['authlevel'];
$cmd = " -v3 -n '' -l '".$device['authlevel']."'";
if ($device['authlevel'] === 'noAuthNoPriv') {
// We have to provide a username anyway (see Net-SNMP doc)
@@ -756,16 +756,16 @@ function snmp_gen_auth(&$device) {
$cmd .= ' -u root';
}
else if ($device['authlevel'] === 'authNoPriv') {
$cmd .= ' -a '.$device['authalgo'];
$cmd .= ' -A "'.$device['authpass'].'"';
$cmd .= ' -u '.$device['authname'];
$cmd .= " -a '".$device['authalgo']."'";
$cmd .= " -A '".$device['authpass']."'";
$cmd .= " -u '".$device['authname']."'";
}
else if ($device['authlevel'] === 'authPriv') {
$cmd .= ' -a '.$device['authalgo'];
$cmd .= ' -A "'.$device['authpass'].'"';
$cmd .= ' -u '.$device['authname'];
$cmd .= ' -x '.$device['cryptoalgo'];
$cmd .= ' -X "'.$device['cryptopass'].'"';
$cmd .= " -a '".$device['authalgo']."'";
$cmd .= " -A '".$device['authpass']."'";
$cmd .= " -u '".$device['authname']."'";
$cmd .= " -x '".$device['cryptoalgo']."'";
$cmd .= " -X '".$device['cryptopass']."'";
}
else {
if ($debug) {