We have a couple of custom plugins, and they are running as they should returning data like:
<PLUGIN>
<COLUMN>
My value
</COLUMN>
</PLUGIN>
These plugins return data depending on various conditions (f.x. is SQL Server installed), and this works fine until conditions change (someone uninstalls SQL Server).
I've tried returning different kinds of empty records like
<PLUGIN></PLUGIN> and <PLUGIN />
But any existing data persist.
How do I, properly, remove outdated data for an agent?
I have created sort of a workaround with an auto-updated TimeStamp column and have the query in cd_plugin.php filter on this TimeStamp being same as, or higher than, LASTDATE but this doesn't really seem like a proper solution.
Especially since this query is not used by the API so I need to do further filtering there as well.
So how do I return a "Delete any existing data" result for plugin?