To effectively limit the number of OCS Inventory Agents connected to the server and block registration of new agents when their number exceeds a certain threshold (like 1000), you would need to implement a custom solution.
- Creating a script to monitor the number of registered agents.
- Modifying the server's configuration or implementing a filter when this number reaches the desired limit.
- Possibly adjusting the Communication Server to reject new agent registrations once the limit is reached.
So sorry i think there is no solution out of the box
perhaps you can try
INVENTORY_FILTER_FLOOD_IP
to limit "aggressive" ip's
https://wiki.ocsinventory-ng.org/03.Basic-documentation/Administration-of-OCS-Inventory-NG/
To use INVENTORY_FILTER_* settings for anti-flooding or filtering by IP in OCS Inventory, you can configure the following options:
Enable inventory flooding filter:
Set INVENTORY_FILTER_FLOOD_IP to 1 in the OCS Inventory configuration
.
Define the anti-flooding period:
Use INVENTORY_FILTER_FLOOD_IP_CACHE_TIME to set the period in seconds. For example, setting it to 300 seconds (5 minutes) will allow only one new computer registration from a specific IP address within that timeframe
.
Enable the inventory filter stack:
Set INVENTORY_FILTER_ON to 1 to activate the filter stack for inventories
.
Configure in Apache:
In the ocsinventory-server.conf file, you can set these options using PerlSetEnv directives:
PerlSetEnv OCS_OPT_INVENTORY_FILTER_FLOOD_IP
PerlSetEnv OCS_OPT_INVENTORY_FILTER_FLOOD_IP_CACHE_TIME 300
PerlSetEnv OCS_OPT_INVENTORY_FILTER_ON
These settings enable the inventory flooding filter, set the cache time to 300 seconds, and turn on the inventory filter stack