in reply to Perl and SNMP
I did something similar (Poll every 30 seconds). I found that using ptree took less time, especially when you know the user id you are running under.
Also, the idea of reading the ps only once and doing searches on the processes instead of grep helps.
Jason