Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

How to delete outdated plugin data?

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?
ago in OCS Inventory NG plugins by (120 points)

Please log in or register to answer this question.

 
Powered by Question2Answer
...