10-11-2005 11:51 AM
Hello, Group. I am attempting to apply a custom KAL script on a service, which will do the following:
1. Do a TCP connection to host A on port 8080.
2. Do a TCP connection to host B on port 8080.
3. Ping host C.
If any of the above fail, the service should be taken down. I have been attempting to combine the built-in TCP connect and Ping list scripts, but with no success. Any advice or sample scripts out there?
Thanks!
10-12-2005 02:51 AM
I think you should provide us your script and let us know what is not working.
Did you capture a trace ?
Is the CSS doing the tcp connections correctly ?
Or is the script not even running ?
Thanks,
Gilles.
10-12-2005 11:27 AM
Gilles, Thanks for the reply. Here is the script I have come up with:
set HOSTA "${ARGS}[1]"
set HOSTB "${ARGS}[2]"
set HOSTC "${ARGS}[3]"
socket connect host ${ARGS}[1] port 8080 tcp
set CONTINUE_ON_ERROR "1"
set SOCKET-STAT "${STATUS}"
set CONTINUE_ON_ERROR "0"
socket disconnect ${SOCKET} graceful
socket connect host ${ARGS}[2] port 8080 tcp
set CONTINUE_ON_ERROR "1"
set SOCKET-STAT "${STATUS}"
set CONTINUE_ON_ERROR "0"
socket disconnect ${SOCKET} graceful
ping ${ARGS}[3] | grep -u Success
if STATUS "NEQ" "0"
show variable UGREP | grep 100
if STATUS "==" "0"
set EXIT_MSG "Ping: Failure to ping ${ARGS}[3]"
exit script 1
It appears to be working, but I am unsure I have entered the script exit commands correctly - to fail on fault.
John
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide