Forum Discussion
Active Discovery (AD) is what tell LogicMonitor what instances exists or not. If you output the instance in the AD script then LM will keep it, if you don't output it, LM will delete it (you would set LM to delete instances in this case).
Perhaps you need to have multiple DataSources for the different situations even if the function (and collection script) are the same. Like having one just for instances you don't want to delete where you can disable deleting. Then have another one that just as the instances you are ok if they delete. I'm kinda assuming there isn't overlap between them.
I would suggest taking some time to work out all the logic and situations. When you want to keep an instance, when it's ok if it's delete, when it should alert, and when it shouldn't, etc. And how they can be determined without manual review. Perhaps that might help determine how to implement it or if things can be separated out.
I would approach it like this. Either you have ActiveDiscovery do its normal thing and at the tail end, if your "required" items aren't there still "Add" them.
Or, as Mike said, create a separate DataSource that will always just have those items, and filter them out of the original DataSource.