I found part of the problem around the execution, I setup a raw text dump in the script and noticed that because I had enabled monitor logging on my pool member in the test pool the F5 was supplying two additional command line arguments that were breaking my code.
So for future awareness, if you enable monitor logging on the pool member you'll get two additional arguments, one stating "log", the second being the the log file which will in /var/log/monitor/...
Aside from that I can see my code is working and connecting, but it is failing to generate an output that is acceptable to the F5. Once I have fixed this and built in some input sanitation I'll update my codeshare.