NOTE: I spent 5 years doing this very thing all day long at Compucom as a HP-UX expert. Getting HP-UX scripts to comply or converting them to be bash compatible was a daily chore. Korn shell has differences that cause issues all the time. I looked at your scripts. I have handled scripts like this. Compucom maintained it's own custom monitoring scripts.
Professional Work:
5 years experience working as a Microsoft Professional.
3 Years of Desktop support using Suse, Ubuntu and Redhat, fiber, cat6, phones.
5 Years of intense Unix experience including all aspects of handling fortune 500 systems from a control center. Auditing, Disaster Recovery, Backups, SANS, ILO and Blades.
Korn (HP-UX) and Bash Shell scripting. Perl scripting. Migration from Korn to Bash.
Creation of all documented procedures for multiple fortune 500 companies.
Change management process for server changes using ITIL.
DHS security clearance.