Bug in script

Working fine but vCenter and Esxi logs are growing

every check create a Login event and a logout event in the event table of the vcenter/Esxi.
We get a lot of check (2 check per VM every 5min). That is generating millions of lines in the vcenter/Esxi database which became very slow. We already reduce the event&task conservation time but not enough.

Does anyone know a way to limite the number of login to vcenter done by the check ?

Regards,
Pradyumna