2013-07-16 Ramon Novoa <rnovoa@artica.es>

* include/functions_snmp_browser.php: Use version 2c by default. Some
	  OIDs may not be available for version 1 queries.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8531 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2013-07-16 18:07:18 +00:00
parent d97e2fcd99
commit 89a01dd446
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2013-07-16 Ramon Novoa <rnovoa@artica.es>
* include/functions_snmp_browser.php: Use version 2c by default. Some
OIDs may not be available for version 1 queries.
2013-07-16 Sergio Martin <sergio.martin@artica.es>
* godmode/massive/massive_delete_alerts.php: Fixed an

View File

@ -163,7 +163,7 @@ function snmp_browser_get_tree ($target_ip, $community, $starting_oid = '.') {
$snmpwalk_bin = $config['snmpwalk'];
}
$oid_tree = array('__LEAVES__' => array());
exec ($snmpwalk_bin . ' -m ALL -M +' . escapeshellarg($config['homedir'] . '/attachment/mibs') . ' -Cc -c ' . escapeshellarg($community) . ' -v 1 ' . escapeshellarg($target_ip) . ' ' . escapeshellarg($starting_oid), $output, $rc);
exec ($snmpwalk_bin . ' -m ALL -M +' . escapeshellarg($config['homedir'] . '/attachment/mibs') . ' -Cc -c ' . escapeshellarg($community) . ' -v 2c ' . escapeshellarg($target_ip) . ' ' . escapeshellarg($starting_oid), $output, $rc);
//if ($rc != 0) {
// return __('No data');
@ -260,7 +260,7 @@ function snmp_browser_get_oid ($target_ip, $community, $target_oid) {
else {
$snmpget_bin = $config['snmpget'];
}
exec ($snmpget_bin . ' -m ALL -M +' . escapeshellarg($config['homedir'] . '/attachment/mibs') . ' -On -v1 -c ' . escapeshellarg($community) . " " . escapeshellarg($target_ip) . ' ' . escapeshellarg($target_oid), $output, $rc);
exec ($snmpget_bin . ' -m ALL -M +' . escapeshellarg($config['homedir'] . '/attachment/mibs') . ' -On -v 2c -c ' . escapeshellarg($community) . " " . escapeshellarg($target_ip) . ' ' . escapeshellarg($target_oid), $output, $rc);
if ($rc != 0) {
return $oid_data;
}