10-05-2004 05:53 AM
I need to configure a CSS service to stay in a down/suspended status when it fails (even when the actual server/service becomes available) - manual failback. Any suggestions? Thanks.
Solved! Go to Solution.
10-06-2004 05:12 AM
Yes, here is a working script I just tested for you ;-). Actually, what the script does is a connection attempt to the server. If the server fails to respond, the script enters CLI commands that suspend the service. Is it what you need ?
Here is the script :
--------------------
!----------------------------------------------------
! Description...: This test script shows how to
! automatically suspend a service
! if the keepalive fails on TCP port.
!
! Parameters : - Service IP address
! - TCP Port of the service
! - Service name
!
! Last version : 06 OCT 2004
!
! Author : Yves Haemmerli, IBM (Switzrland)
!
!-------------------------------------------------
!
! no echo
!-------------------------------------------------
! Constants declaration
!-------------------------------------------------
!
set CONTINUE_ON_ERROR "1"
!-------------------------------------------------
! Messages for manual playing
!-------------------------------------------------
!
!
set ConnectOK "script: Connection Successful"
set ConnectKO "script: Connection Failed"
!
!
socket connect host ${ARGS}[1] port ${ARGS}[2] tcp 2000
if STATUS "NEQ" "0"
echo "${ConnectKO}"
configure
service TEST
suspend
exit
exit script 1
endbranch
socket disconnect ${SOCKET} graceful
echo "${ConnectOK}"
exit script 0
!
Here is the CSS service configuration :
---------------------------------------
service TEST
ip address 192.168.1.100
protocol tcp
port 80
keepalive frequency 15
keepalive type script automatic-suspend "192.168.1.100 80 TEST"
active
I hope this will help you
Yves Haemmerli
10-05-2004 06:54 AM
One option would be to use the scripting language of the CSS to write a keepalive script that would suspend the service if the keepalive fails. The drawback is that you cannot use the maxfailure parameter because the script would suspend the service just after the first service failure to respond to the keepalive.
Yves Haemmerli
10-05-2004 11:27 AM
I wrote a few CSS keepalive scripts, but I don't know how could I suspend a service within a script. Would you please share your expertise? Thanks!
10-06-2004 05:12 AM
Yes, here is a working script I just tested for you ;-). Actually, what the script does is a connection attempt to the server. If the server fails to respond, the script enters CLI commands that suspend the service. Is it what you need ?
Here is the script :
--------------------
!----------------------------------------------------
! Description...: This test script shows how to
! automatically suspend a service
! if the keepalive fails on TCP port.
!
! Parameters : - Service IP address
! - TCP Port of the service
! - Service name
!
! Last version : 06 OCT 2004
!
! Author : Yves Haemmerli, IBM (Switzrland)
!
!-------------------------------------------------
!
! no echo
!-------------------------------------------------
! Constants declaration
!-------------------------------------------------
!
set CONTINUE_ON_ERROR "1"
!-------------------------------------------------
! Messages for manual playing
!-------------------------------------------------
!
!
set ConnectOK "script: Connection Successful"
set ConnectKO "script: Connection Failed"
!
!
socket connect host ${ARGS}[1] port ${ARGS}[2] tcp 2000
if STATUS "NEQ" "0"
echo "${ConnectKO}"
configure
service TEST
suspend
exit
exit script 1
endbranch
socket disconnect ${SOCKET} graceful
echo "${ConnectOK}"
exit script 0
!
Here is the CSS service configuration :
---------------------------------------
service TEST
ip address 192.168.1.100
protocol tcp
port 80
keepalive frequency 15
keepalive type script automatic-suspend "192.168.1.100 80 TEST"
active
I hope this will help you
Yves Haemmerli
10-06-2004 05:17 AM
Thanks! I didn't know that you could actually execute a config command within a script. Thanks again.
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