09-09-2003 12:43 PM
Hi
We are using css110501 CSS.
Right now the keepalives on services are set using hash values.
But i want to change this keepalives to implement keepalives with regular expression checking.
Any Ideas?
Solved! Go to Solution.
09-11-2003 09:44 AM
The CSS supports it's own native scripting language that can be used to write keepalives among other things.
Here is an example of a script that I wrote to check a page for some specific text:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Filename: ap-kal-statpage
! Parameters: None - must be coded in script
!
! Description:
!
! This script will attempt to connect to a host and
! "GET" an html page. The script checks the contents
! of the page for a particular string. If the string
! is found, the script passes.
!
! Failure Upon:
! 1. The correct arguments are not supplied.
! 2. The CSS is unable to connect to the host.
! 3. The string is not found in the page.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
no echo
if ${ARGS}[#] "LT" "4"
echo "Usage: ap-kal-portlist \'Hostname Port Page String ...\'"
exit script 1
endbranch
set host "${ARGS}[1]"
set port "${ARGS}[2]"
set page "${ARGS}[3]"
set string "${ARGS}[4]"
set EXIT_MSG "Host ${host} not responding on TCP port ${port}."
socket connect host ${host} port ${port} tcp
socket send ${SOCKET} "GET ${page} HTTP/1.0\n\n"
set EXIT_MSG "String was not found."
socket waitfor ${SOCKET} "${string}" 200
socket disconnect ${SOCKET}
echo "String ${string} was found."
no set EXIT_MSG
exit script 0
09-09-2003 01:37 PM
You would need a scripted keepalive using socket commands for this.
09-11-2003 09:37 AM
say here is my current service
service ag
ip address 192.168.3.30
keepalive type http
keepalive method get
keepalive port 80
keepalive uri "/ag"
active
I have less idea about scripts.
suppose if u want to configure this keepalive using
a script how to do that?
09-11-2003 09:44 AM
The CSS supports it's own native scripting language that can be used to write keepalives among other things.
Here is an example of a script that I wrote to check a page for some specific text:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Filename: ap-kal-statpage
! Parameters: None - must be coded in script
!
! Description:
!
! This script will attempt to connect to a host and
! "GET" an html page. The script checks the contents
! of the page for a particular string. If the string
! is found, the script passes.
!
! Failure Upon:
! 1. The correct arguments are not supplied.
! 2. The CSS is unable to connect to the host.
! 3. The string is not found in the page.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
no echo
if ${ARGS}[#] "LT" "4"
echo "Usage: ap-kal-portlist \'Hostname Port Page String ...\'"
exit script 1
endbranch
set host "${ARGS}[1]"
set port "${ARGS}[2]"
set page "${ARGS}[3]"
set string "${ARGS}[4]"
set EXIT_MSG "Host ${host} not responding on TCP port ${port}."
socket connect host ${host} port ${port} tcp
socket send ${SOCKET} "GET ${page} HTTP/1.0\n\n"
set EXIT_MSG "String was not found."
socket waitfor ${SOCKET} "${string}" 200
socket disconnect ${SOCKET}
echo "String ${string} was found."
no set EXIT_MSG
exit script 0
09-19-2003 09:41 AM
Thanks, This script worked very well.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: