2013-05-20 Junichi Satoh <junichi@rworks.jp>
* include/functions_snmp_browser.php: Added default binary path for snmpget and snmpwalk in *BSD. The paths can also be defined specific ones by using config['snmpget'] and config['snmpwalk']. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8155 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
828c036115
commit
18b7a1bfb8
|
@ -1,3 +1,9 @@
|
||||||
|
2013-05-20 Junichi Satoh <junichi@rworks.jp>
|
||||||
|
|
||||||
|
* include/functions_snmp_browser.php: Added default binary path for
|
||||||
|
snmpget and snmpwalk in *BSD. The paths can also be defined specific
|
||||||
|
ones by using config['snmpget'] and config['snmpwalk'].
|
||||||
|
|
||||||
2013-05-17 Miguel de Dios <miguel.dedios@artica.es>
|
2013-05-17 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* include/functions_ui.php: added first version of function
|
* include/functions_ui.php: added first version of function
|
||||||
|
|
|
@ -146,8 +146,24 @@ function snmp_browser_get_tree ($target_ip, $community, $starting_oid = '.') {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call snmpwalk
|
// Call snmpwalk
|
||||||
|
if ($config['snmpwalk'] == '') {
|
||||||
|
switch (PHP_OS) {
|
||||||
|
case "FreeBSD":
|
||||||
|
$snmpwalk_bin = '/usr/local/bin/snmpwalk';
|
||||||
|
break;
|
||||||
|
case "NetBSD":
|
||||||
|
$snmpwalk_bin = '/usr/pkg/bin/snmpwalk';
|
||||||
|
braek;
|
||||||
|
default:
|
||||||
|
$snmpwalk_bin = 'snmpwalk';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$snmpwalk_bin = $config['snmpwalk'];
|
||||||
|
}
|
||||||
$oid_tree = array('__LEAVES__' => array());
|
$oid_tree = array('__LEAVES__' => array());
|
||||||
exec ('snmpwalk -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 1 ' . escapeshellarg($target_ip) . ' ' . escapeshellarg($starting_oid), $output, $rc);
|
||||||
|
|
||||||
//if ($rc != 0) {
|
//if ($rc != 0) {
|
||||||
// return __('No data');
|
// return __('No data');
|
||||||
|
@ -228,7 +244,23 @@ function snmp_browser_get_oid ($target_ip, $community, $target_oid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$oid_data['oid'] = $target_oid;
|
$oid_data['oid'] = $target_oid;
|
||||||
exec ('snmpget -m ALL -M +' . escapeshellarg($config['homedir'] . '/attachment/mibs') . ' -On -v1 -c ' . escapeshellarg($community) . " " . escapeshellarg($target_ip) . ' ' . escapeshellarg($target_oid), $output, $rc);
|
if ($config['snmpget'] == '') {
|
||||||
|
switch (PHP_OS) {
|
||||||
|
case "FreeBSD":
|
||||||
|
$snmpget_bin = '/usr/local/bin/snmpget';
|
||||||
|
break;
|
||||||
|
case "NetBSD":
|
||||||
|
$snmpget_bin = '/usr/pkg/bin/snmpget';
|
||||||
|
braek;
|
||||||
|
default:
|
||||||
|
$snmpget_bin = 'snmpget';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
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);
|
||||||
if ($rc != 0) {
|
if ($rc != 0) {
|
||||||
return $oid_data;
|
return $oid_data;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue