A10 support TCL (Tool Command Language) to scripting health check with youself.
Here is copy from config guide. It open a socket connect to HTTP, and get /1.html then paeser a string.
# Init server status to "DOWN" set ax_env(Result) 1 # Open a socket if {[catch {socket $ax_env(ServerHost) $ax_env(ServerPort)} sock]} { puts stderr "$ax_env(ServerHost): $sock" } else { fconfigure $sock -buffering none -eofchar {} # Send the request puts $sock "GET /1.html HTTP/1.0\n" # Wait for the response from http server set line [read $sock] if { [ regexp "HTTP/1.. (\[0-9\]+) " $line match status] } { puts "server $ax_env(ServerHost) response : $status" # Check exit code if { $status == 200 } { # Set server to be "UP" set ax_env(Result) 0 } } close $sock }
# Init server status to "DOWN" set ax_env(Result) 1 # Open a socket if {[catch {socket $ax_env(ServerHost) $ax_env(ServerPort)} sock]} { puts stderr "$ax_env(ServerHost): $sock" } else { fconfigure $sock -buffering none -eofchar {} # Send the request "some_string" and return puts $sock "talk\n" # Wait for the response from TCP service set line [read $sock] if { [ regexp "Works" $line ] } { # Set server to be "UP" set ax_env(Result) 0 } close $sock }