Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

script writing for keepalive for CSS11506

Hi,

I need write a script for health check:

1. a tcp port

2. the backend server will send a banner which include "END".

I have changed a little about ap-kal-tcp-ports (an example in css docs)

function SOCKET_CONNECT begin

set CONTINUE_ON_ERROR "1"

socket connect host ${SERVICE} port ${TCP-PORT} tcp 2000

socket waitfor ${SOCKET} "end" case-sensitive

set SOCKET-STAT "${STATUS}"

set CONTINUE_ON_ERROR "0"

socket disconnect ${SOCKET} graceful

function SOCKET_CONNECT return "${SOCKET-STAT}"

function SOCKET_CONNECT end

service test

ip address 10.1.1.21

protocol tcp

port 2304

keepalive type script ap-kal-tcp-ports-jx "10.1.1.21 2304"

keepalive frequency 20

active

it is working for health check, but, it is not care if there is a "end" existed or not.

Could anyone advice me how can I check a string in keepalive responce from backend server?

Any comments will be appreciated

Thanks in advance

162
Views
0
Helpful
0
Replies
CreatePlease to create content