You may want to take a look at Big sister, it is written in Perl. Perhaps you could install it to see if it does most of what you want, and write your own Oracle monitoring code. This has been suggested in the past for system monitoring solutions, please use Super Search before posting.