discoveryCheck.php doesn't discover
phpipam open-source IP address management
Brought to you by:
myha
Hi,
when i execute discoveryCheck.php no ip will found
in script functions-network.php there was a bug in function "getSubnetsToDiscover", it's works well when manualy scan a subnet but when do massive scan there some problem with array
$ip
from this code:
# set vars $ip = array(); //we store IPs to scan to this array # ok, we have subnets. Now we create array of all possible IPs for each subnet, # and remove all existing foreach($subnets as $s) { // get all existing IP addresses $addresses = getIpAddressesBySubnetId ($s['id']); // set start and end IP address $calc = calculateSubnetDetailsNew ( $s['subnet'], $s['mask'], 0, 0, 0, 0 ); // loop and get all IP addresses for ping for($m=1; $m<=$calc['maxhosts']; $m++) { // save to array for return $ip[$m]['ip_addr'] = $s['subnet']+$m; $ip[$m]['subnetId'] = $s['id']; // save to array for existing check $ipCheck[$m] = $s['subnet']+$m; } // remove already existing foreach($addresses as $a) { $key = array_search($a['ip_addr'], $ipCheck); if($key!==false) { unset($ip[$key]); } } # return result return $ip;
to this code:
# set vars $global_ip = array(); //we store IPs to scan to this array # ok, we have subnets. Now we create array of all possible IPs for each subnet, # and remove all existing foreach($subnets as $s) { $ip = array(); $ipCheck = array(); // get all existing IP addresses $addresses = getIpAddressesBySubnetId ($s['id']); // set start and end IP address $calc = calculateSubnetDetailsNew ( $s['subnet'], $s['mask'], 0, 0, 0, 0 ); // loop and get all IP addresses for ping for($m=1; $m<=$calc['maxhosts']; $m++) { // save to array for return $ip[$m]['ip_addr'] = $s['subnet']+$m; $ip[$m]['subnetId'] = $s['id']; // save to array for existing check $ipCheck[$m] = $s['subnet']+$m; } // remove already existing foreach($addresses as $a) { $key = array_search($a['ip_addr'], $ipCheck); if($key!==false) { unset($ip[$key]); } } $global_ip = array_merge($global_ip,$ip); } # return result return $global_ip;
Anonymous
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Unfortunately, even after applying the patch to functions-network.php, discoveryCheck.php is not working for me. It was seemingly doing something for 20 minutes, then I had to break it. The load skyrocketed from 0.05 to 80 on a dedicated virtual machine.
Manual scan and pingcheck is working nicely.
I have 460 subnets (mask mostly > /24, nothing < /21) and 3330 IP addresses.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Awesome. This worked for me. :)
I have /16 network subnetted into /24 among which 30+ subnets are configured on phpipam. Script takes around 5 minutes but discovers like a BOOOOM.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Same thing happened to me.
==
Unfortunately, even after applying the patch to functions-network.php, discoveryCheck.php is not working for me. It was seemingly doing something for 20 minutes, then I had to break it. The load skyrocketed from 0.05 to 80 on a dedicated virtual machine.
==
Ross.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
tried this.. now i got no errors.. but still no output ..
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
I have the same issue.
Then i thought to use the fpingdiscovery check, but it requires fping 3.0 and my linux build only has the 2.4 available (Fedora 14 build). I noticed that the original code that is pasted above was putted in comment.