Disabling sql text collection for oracle agents via groovy

Hello. I would like to share a script which I think might be useful for other Foglight users.

When you create an oracle agent it starts collecting top sql texts by default. If you create loads of oracle agents you might observe data churn on DBO_Top_Sql and DBO_Top_Sql objects. The straightforward way to disable this collection would be via administer database agent dashboard however this might be slow depending on your server hardware and number of oracle agents.

Attached files are the groovy scripts which can change this setting via foglight command. As I couldn't find a better way to do this, the row number for the relevant property in the secondary property is hard coded(see the picture below). So before using these scripts you need to make sure that ROW_IDX has the right value. I recommend testing this with one agent first in case you counted it wrong.

Depending on what you need these two scripts can be combined and the secondary propery can be cloned for each agent. In this script I cloned the default secondary property once and changed it for all agents. Please post on this page if you have any enhancement ideas for these scripts.