8-55
Cisco Content Services Switch Administration Guide
OL-5647-02
Chapter 8 Using the CSS Scripting Language
Script Keepalive Examples
Finger Keepalive
!no echo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Filename: ap-kal-finger
! Parameters: HostName UserName
!
! Description:
! This script will connect to the finger server on the remote
! host. It will query for the UserName and receive the
! information back.
!
! Failure Upon:
! 1. Not establishing a connection with the host.
! 2. Not being able to send/receive data to the host
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if ${ARGS}[#] “NEQ” “2”
echo “Usage: ap-kal-finger \'Hostname UserName\'”
exit script 1
endbranch
! Defines:
set HostName “${ARGS}[1]”
set UserName “${ARGS}[2]”
set EXIT_MSG “Connection Failed”
! Connect to the remote host (use default timeout)
socket connect host ${HostName} port 79 tcp
set EXIT_MSG “Send: Failed”
! Send the username to “finger”
socket send ${SOCKET} “${UserName}\n”
set EXIT_MSG “Waitfor: Failed”
! Wait for data for 100ms (default)
socket waitfor ${SOCKET} “${UserName}”
no set EXIT_MSG
! If the data came in, then we are good to quit
socket disconnect ${SOCKET}
no set EXIT_MSG
exit script 0
Содержание 11500 Series
Страница 16: ...Contents xvi Cisco Content Services Switch Administration Guide OL 5647 02 ...
Страница 18: ...Figures xx Cisco Content Services Switch Administration Guide OL 5647 02 ...
Страница 120: ...Chapter 3 Configuring User Profiles Where to Go Next 3 16 Cisco Content Services Switch Administration Guide OL 5647 02 ...