I have a discovery that runs every hour, I need that when it finds a new device it sets its status as "unallocated", by default it set it as "production". Status of devices previusly discovered must not be modified.
How to do this?
Status is not the correct attribute to use for this. When a device is found it will always have its status set to 'production'. You might look at using the OrgId instead. If it's still set to the Default Org, you'll know it needs to be allocated. Obviously, you'll need to create another Org. In the discovery, you should leave "Assign to Org" blank. That way any new devices found will be allocated to the OrgId of the Discovery, but any existing devices discovered will not be changed.
You can quickly update existing devices using the Bulk Edit functionality.