OCSInventory-NG / OCSInventory-Server

Communication server of OCS Inventory
http://www.ocsinventory-ng.org/
GNU General Public License v2.0
340 stars 138 forks source link

IpDiscover does not find machines on the network #449

Open cairoapcampos opened 6 months ago

cairoapcampos commented 6 months ago

General informations

Operating system : Linux Debian 12

Server informations

Perl version : 5.36.0 Mariadb: 10.11.4

OCS Inventory informations

Ocs server version : 2.12.1

Problem's description

I create the subnet by following the steps below in the web interface:

Manage -> Network scan -> Administer subnet -> ADD.

I run the following command on the VM that has the OCS Server and the OCS Agent:

perl ipdiscover-util.pl -network=192.168.2.0/24 -scantype=nmap -h=localhost  -d=ocsdb -u=ocsuser -p=ocspass

Command output:

output

I noticed that without executing the command no machines are listed. From what I saw in the documentation, some machines that have an agent are elected and scan the network. In my tests, no machine was automatically found by IpDiscover.

I'm using virtualbox to test OCS. The VM with IP 192.168.2.2 is the OCS Server. The gateway 192.168.2.1 does not exist. The machines are on the same network. Could this be the problem? Can you help me?

cairoapcampos commented 6 months ago

Additional screens as per previous example:

out1 out2 out3

gillesdubois commented 6 months ago

Hi @cairoapcampos

First, I see you are testing OCS in a virtual / test environement, that might be the reason why you don't have automatic election. Possible reasons are multiple but if you have a infrastructure with agent you trigger from time to time to test, they won't be elected as IPDiscover agent.

OCS need the agent to come regularly to be elected, that's what we call the fidelity score. My first question abou the non election would be :

Concerning the script and the output in the webconsole there is two tabs :

The main issue you encounter is that the 192.168.2.2 machine is reconciliated with its agent entry. This behavior can be normal as the IPDiscover script is more intended to be used in network where there is no agent (network full of net devices for example).

Regards, Gilles DUBOIS.

cairoapcampos commented 6 months ago

I recreated the virtualized environment. I installed the server and agent on the Debian VM.

Also create two Windows machines. One is using the agent and the other does not have it.

I configured the bridge network type on the VMs, this way they can use IPs from a real network. Now they have a gateway.

For this new test I did not run the ipdiscover-util.pl script. Now just wait for the nodes to be elected so that network devices are found automatically?

One question I have is knowing the difference between the "Non-Inventored" and "IpDiscover" columns on the second screen. What is the difference between these columns?

Below are some images of the current test environment.

Screen 1:

tela1

Screen 2:

tela2

Screen 3:

tela3

Lea9250 commented 5 months ago

Hi @cairoapcampos ,

"Non-inventoried" is pretty much self-explanatory, these are devices that do not have an OCS agent installed. "IpDiscover" refers to Ipdiscover elected devices, i.e. agent's performing the ipdisover scan.

Regards, Léa