Using the IpDiscover Scanner

This script is meant as an alternative to the existing IpDiscover perl script included with ocsreports. It will not insert data into the database, but the results of the scan will be output to a file in XML format. The files can then be injected into an OCS server, either by using the perl injector script or any tool able to POST data to /ocsinventory.


  • Python 3.6+
  • fping
  • nmap

Install the required packages on Debian-based systems:

apt install fping nmap


Clone the repository:

git clone

Then, to start the scanner, run the file in the root folder.

Detailed example:

python3 --scantype=<fping || nmap> --subnets=[X.X.X.X/XX || X.X.X.X/XX:tag] --output_dir=<yourOutputDirectory> --debug


  • --scantype - The type of scan to perform, fping or nmap. Required.
  • --subnets - A comma separated list of subnets to scan. Required. The format is subnet:tag, where tag is optional.
  • --output_dir - The directory where the output files will be saved. Defaults to the results directory in the script's directory.
  • --debug - Enable debug output. Optional.

Example usage:

python3 --scantype=fping --subnets=, --output_dir=/tmp/ --debug

This will scan the subnets and using fping and output the results to the /tmp/ directory. The "tag15" tag will be added to all the hosts in the subnet. The tag is optional and can be omitted. The debug flag will output additional information to the console such as command outputs.

Injecting the results into OCS

See the OCS documentation for more information on how to inject the results into OCS.

The perl injector script is included with the OCS installation. It can be found in the binutils directory of the server. The script is called (see on Github)