Script Keepalive Examples
Time Keepalive
Cisco Content Services Switch Administration Guide
8-56
!no echo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Filename: ap-kal-time
! Parameters: HostName
!
! Description:
!
This script will connect to a remote host 'time' service on
!
port 37 and get the current time.
!
strictly with TCP.
!
! Failure Upon:
!
1. Not establishing a connection with the host.
!
2. Not being able to receive incoming data
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Make sure the user has a qualified number of arguments
if ${ARGS}[#] "NEQ" "1"
echo "Usage: ap-kal-time \'Hostname\'"
exit script 1
endbranch
! Defines:
set HostName "${ARGS}[1]"
set EXIT_MSG "Connection Failed"
! Connect to the remote host (use default timeout)
socket connect host ${HostName} port 37 tcp 2000
set EXIT_MSG "Receive: Failed"
! waitfor any data for 2000ms
socket waitfor ${SOCKET} anything 2000
! If the data came in, then we are good to quit
socket disconnect ${SOCKET}
no set EXIT_MSG
exit script 0
Chapter 8
This script currently works
[Ref. RFC-868]
Using the CSS Scripting Language
OL-5647-02