Forum Discussion

mmelber14_62984's avatar
mmelber14_62984
Icon for Nimbostratus rankNimbostratus
Apr 02, 2014

External Health monitor

Hi,   I need some assistance creating shell script for use in a external health monitor. I do to have much experience in creating scripts so if someone could either assist or point me to a good re...
  • uni_87886's avatar
    Apr 03, 2014

    Hi Megan,

    LTM health monitors run on you BigIP and communicate with remote services over the network. What you have provided looks like something which runs on a remote box. To be able to use the output from that command to mark a service up or down, you need to get the output to your BigIP. Two solutions come to mind:

    1. On the msql host, create a file with your commands in it, eg mytest. Then create a listener with netcat to run it when it receives a connection from the network

      while : ; do nc -vl -e mytest 1234; done

      Now you can use a TCP monitor on the F5 which sends to port 1234 (in my example), and expects "Success" in the result. You will need to consider how to keep that process started and running on the msql box, and there are probably opportunities for DOS or other security issues.

    2. Create the bash script on your msql box as before. On the F5, create an external monitor (plenty of examples on DevCentral) which uses ssh to execute this. This is more complicated (though is not hard to implement), uses more system resources on both the F5 and your msql box, but more secure, and I suspect more robust too.

    Of course, I might have completely misunderstood your requirement, but I hope that helps.