i am looking a way to clear comments automaticallt for hosts and service plugins when it recovers
Sounds like a bad plan to me. For example: A very important host goes down, and I make a very important comment. Then the host recovers for ONE SINGLE 5 minute period and fails again. Now my important comment is lost, and contained instructions for the tech on duty to perform. Now I have to login to the site and make the comments again, only for the comments to be destroyed yet again by your “auto-clear”. In essence, you have removed the feature completely.