phpipam / phpipam-agent

phpipam scan agent
89 stars 43 forks source link

Scan agent incorrectly marking IPs as discovered that are unused #74

Open 9strands opened 3 years ago

9strands commented 3 years ago

Versions: PHPIPAM host: PHP IPAMversion 1.5 with PHP 7.3.20 PHPIPAM-agent host https://github.com/phpipam/phpipam-agent master branch as of 2021-08-29 with PHP 7.4.22

We're trying to scan a /22. When I run the scan agent, it manually detects which IPs are up and not up according to the debug output when I run the scan manually. However, in the PHPIPAM dashboard, all IP's in the subnet are marked as discovered.

For example - running php index.php update prints the following details out:

ICMP Host Unreachable from 172.23.241.13 for ICMP Echo sent to 172.23.240.3 ICMP Host Unreachable from 172.23.241.13 for ICMP Echo sent to 172.23.240.9 ICMP Host Unreachable from 172.23.241.13 for ICMP Echo sent to 172.23.240.8 ICMP Host Unreachable from 172.23.241.13 for ICMP Echo sent to 172.23.240.7 ICMP Host Unreachable from 172.23.241.13 for ICMP Echo sent to 172.23.240.6 ICMP Host Unreachable from 172.23.241.13 for ICMP Echo sent to 172.23.240.5 ICMP Host Unreachable from 172.23.241.13 for ICMP Echo sent to 172.23.240.4 ... 172.23.240.1 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 0.706/0.706/0.706 172.23.240.2 : xmt/rcv/%loss = 1/1/0%, min/avg/max = 0.739/0.739/0.739 172.23.240.3 : xmt/rcv/%loss = 1/0/100% 172.23.240.4 : xmt/rcv/%loss = 1/0/100% 172.23.240.5 : xmt/rcv/%loss = 1/0/100% 172.23.240.6 : xmt/rcv/%loss = 1/0/100% 172.23.240.7 : xmt/rcv/%loss = 1/0/100% 172.23.240.8 : xmt/rcv/%loss = 1/0/100% ...

However, in the subnet, these IPs all show up as online after the scan agent connects to the database and provides an update.

image

superusergoose commented 2 years ago

I'm experiencing the same issue, I have not yet found a solution

jsblock78 commented 1 year ago

I ran into this issue when method was fping, however with pear I got expected results.

WagoL commented 1 year ago

I ran into this issue when method was fping, however with pear I got expected results.

How is your config with pear?

jackychan114 commented 8 months ago

I have the same problem, which has not been solved yet.

DPxCruelty commented 4 months ago

My system environment is Rocky linux 9.3+PHP8.0, after debugging, I found that when class.Scon.php is scanned using fping, no matter whether the IP is reachable or not, there is a return value in the output, and the logic doesn't filter the timeout entries, I added an if function to deal with it, and it seems to be running normally at the moment! In class.Scon.php on line 449 image