8-59
Cisco Content Services Switch Administration Guide
OL-5647-02
Chapter 8 Using the CSS Scripting Language
Script Keepalive Examples
! Send the GET request for the web page, along with the authorization
! This builds a header block like so:
!
! GET /index.html HTTP/1.0\r\n
! Authorization: Basic bGFiOmxhYnRlc3Qx\r\n\r\n
set EXIT_MSG “Send: Failed”
socket send ${SOCKET} “GET ${WebPage} HTTP/1.0\n”
socket send ${SOCKET} “Authorization: Basic “
socket send ${SOCKET} “${UserPass}” base64
socket send ${SOCKET} “\n\n”
! Wait for a good status code
set EXIT_MSG “Waitfor: Failed”
socket waitfor ${SOCKET} “200 OK”
no set EXIT_MSG
socket disconnect ${SOCKET}
exit script 0
DNS Keepalive
!no echo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Filename: ap-kal-dns
! Parameters: Server DomainName
!
! Description:
!
This script will resolve a domain name from a specific DNS
!
server. This builds a UDP packet based on RFC-1035
!
! Failure Upon:
! 1. Not resolving the hosts's IP from the domain name
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if ${ARGS}[#] “NEQ” “1”
echo “Usage: ap-kal-finger \'Hostname\'”
exit script 1
endbranch
set HostName “${ARGS}[1]
! Connect to the remote host
set EXIT_MSG “Connection failed”
socket connect host ${HostName} port 53 udp
Содержание 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 ...