Add -a to arp, add ZM_PATH_OUI for path to ieee-oui.txt
parent
c4302c27ac
commit
fccebee056
|
@ -694,12 +694,12 @@ function get_arp_results() {
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
if (count($result)==1) {
|
if (count($result)==1) {
|
||||||
$arp_command .= ' -n';
|
$arp_command .= ' -an';
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = exec(escapeshellcmd($arp_command), $output, $status);
|
$result = exec(escapeshellcmd($arp_command), $output, $status);
|
||||||
if ($status) {
|
if ($status) {
|
||||||
ZM\Error("Unable to probe network cameras, status is '$status'");
|
ZM\Error("Unable to probe network cameras using $arp_command, status is '$status' output is ".implode("\n", $output));
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
foreach ($output as $line) {
|
foreach ($output as $line) {
|
||||||
|
@ -779,7 +779,8 @@ function probeNetwork() {
|
||||||
ZM\Warning('No content from '.ZM_PATH_DATA.'/MacVendors.json');
|
ZM\Warning('No content from '.ZM_PATH_DATA.'/MacVendors.json');
|
||||||
}
|
}
|
||||||
$macBases = json_decode($macVendors, true);
|
$macBases = json_decode($macVendors, true);
|
||||||
$oui_txt = file_get_contents('/usr/share/arp-scan/ieee-oui.txt');
|
if (defined('ZM_PATH_OUI') and ZM_PATH_OUI and file_exists(ZM_PATH_OUI)) {
|
||||||
|
$oui_txt = file_get_contents(ZM_PATH_OUI);
|
||||||
if (!$oui_txt) {
|
if (!$oui_txt) {
|
||||||
ZM\Warning('No content from /usr/share/arp-scan/ieee-oui.txt');
|
ZM\Warning('No content from /usr/share/arp-scan/ieee-oui.txt');
|
||||||
} else {
|
} else {
|
||||||
|
@ -795,6 +796,9 @@ function probeNetwork() {
|
||||||
}
|
}
|
||||||
#ZM\Debug("bases: " . print_r($macBases, true));
|
#ZM\Debug("bases: " . print_r($macBases, true));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ZM\Debug("No ieee-oui.txt");
|
||||||
|
}
|
||||||
|
|
||||||
foreach (get_arp_results() as $mac=>$ip) {
|
foreach (get_arp_results() as $mac=>$ip) {
|
||||||
if ($filter_ip and ($ip != $filter_ip)) {
|
if ($filter_ip and ($ip != $filter_ip)) {
|
||||||
|
|
Loading…
Reference in New Issue