I was having problems keeping the agent running so I went and made a one line patch to remove the sleep line. Once I did that and moved the agent to running on cron I haven't had a real problem with the agent in 2 years. This week I decided to write up the patch into a proper patch but the basic's of this patch has been in use on my site for 2 years.
Patch to ispman-agent.
Updated patch had a logic mistake in the 1st one.