Smtp Keepalive - Cisco 11503 - CSS Content Services Switch Administration Manual

Content services switch
Hide thumbs Also See for 11503 - CSS Content Services Switch:
Table of Contents

Advertisement

Script Keepalive Examples

SMTP KEEPALIVE

Cisco Content Services Switch Administration Guide
8-48
!no echo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Filename: ap-kal-smtp
! Parameters: HostName
!
! Description:
!
This script will log into an SMTP server and send a 'hello'
!
to make sure the SMTP server is stable and active.
!
! Failure Upon:
!
1. Not establishing a connection with the host.
!
2. Failure to get a good status code after saying 'hello'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Make sure the user has a qualified number of arguments
if ${ARGS}[#] "NEQ" "1"
echo "Usage: ap-kal-smtp \'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 25 tcp
set EXIT_MSG "Waitfor: Failed"
! Receive the incoming status code 220 "welcome message"
socket waitfor ${SOCKET} "220" 200
set EXIT_MSG "Send: Failed"
! Send the helo to the server
socket send ${SOCKET} "helo ${HostName}\n"
set EXIT_MSG "Waitfor: Failed"
! Wait for status code "250" to be returned
socket waitfor ${SOCKET} "250" 200
! We've successfully logged in, the server is up and running.
! The job was done successfully.
socket disconnect ${SOCKET}
no set EXIT_MSG
exit script 0
Chapter 8
Using the CSS Scripting Language
OL-5647-02

Advertisement

Table of Contents
loading

This manual is also suitable for:

11500 series

Table of Contents