cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
569
Views
0
Helpful
1
Replies

Probe Script fails on CSM

gsuarez0514
Level 1
Level 1

Before our upgrade to a 6513 the following script worked. I have upgraded our CSM's to 4.2(5) thought this would solve our problem since the script did not change but it did not. The script is as follows:

#!name = HTTPCONTENT_PROBE

########################################################################################

#

# Description :

# Script sends a http 1.0 GET request to a idmsprod server cluster to determine if

# servers are functional

#

# CSM version :

# 4.2 (5)

#

# Parameters :

# <requestHearder> [debugFlag]

# regquestHeader - HTTP request to send e.g "GET /yahoo.html HTTP/1.0"

# debugFlag - default 0. Do NOT turn on while multiple probes are configured

#

# Example config :

# probe httpProbe script

# script HTTPCONTENT_PROBE "GET /yahoo.html HTTP/1.0" 0

#

########################################################################################

#-------------------------------------------

# debug procedure

# set the EXIT_MSG environment varaible to help debug

# also print the debug message when debug flag is on

#-------------------------------------------

proc csm_debug { msg } {

global debug ip port EXIT_MSG

set EXIT_MSG $msg

if { [ info exists ip ] && [ info exists port ] } {

set EXIT_MSG "[ info script ]:$ip:$port: $EXIT_MSG "

}

if { [ info exists debug ] && $debug } {

puts $EXIT_MSG

}

}

#-------------------------------------------

# main

#-------------------------------------------

# parse cmd line args and initialize variables

csm_debug "initializing varaible"

if { $argc < 1 } {

set EXIT_MSG "ERR config: script HTTPCONTENT_PROBE <requet_header> <expectFileTyep> <debug(0|1)\texample : script HTTPCONTENT_PROBE_SCRIPT \"GET / HTTP/1.0\" html 0"

puts $EXIT_MSG

exit 5001

}

set ip $csm_env(realIP)

set port $csm_env(realPort)

# if port is zero the use well known http port 80

if { $port == 0} {

set port 80

}

set requestHeader [ lindex $argv 0 ]

set expectFileType [ lindex $argv 1 ]

set debug [ lindex $argv 2 ]

if { $debug == "" } {

set debug 0

}

# open connection

csm_debug "opening socket"

set sock [ socket $ip $port ]

# send http requeset to server

csm_debug "sending request : $requestHeader"

puts -nonewline $sock "$requestHeader\n\n"

flush $sock

# read string back from server

csm_debug "receiving response"

set lines [ read $sock ]

# close connection

csm_debug "closing socket"

close $sock

# parsing http response to decide if probe success or failed

# all the following condition casing probe faile. should return exit 5001

if { ![ regexp -nocase "^HTTP/1\.\[0-9\] (\[0-9\]\[0-9\]\[0-9\])" $lines match statuscode ] } {

csm_debug "probe fail : can't find status code"

exit 5001

}

if { $statuscode != "200" } {

csm_debug "probe fail : status code is $statuscode"

exit 5001

}

if { ![ regexp -nocase "Please type the Livelink Administrator password in the" $lines ]} {

csm_debug "probe fail : does not find correct text"

exit 5001

}

# Everything went fine. probe exit with success exit_code 5000

csm_debug "probe success"

exit 5000

1 Accepted Solution

Accepted Solutions

Gilles Dufour
Cisco Employee
Cisco Employee

I tested your probe and it works for me.

What you can do is attach a PC to the csm console port [you will need to unscrew the cache and use a regular ethernet cable to connect to the console instead of a console cable].

Then set the debug on with your script with the cmd :

script HTTPCONTENT_PROBE "GET / HTTP/1.0" html 1

You will start receiving messages that will indicate what is going on.

You can also try to capture a sniffer trace and see if the server respond correctly with the expected text.

Gilles.

View solution in original post

1 Reply 1

Gilles Dufour
Cisco Employee
Cisco Employee

I tested your probe and it works for me.

What you can do is attach a PC to the csm console port [you will need to unscrew the cache and use a regular ethernet cable to connect to the console instead of a console cable].

Then set the debug on with your script with the cmd :

script HTTPCONTENT_PROBE "GET / HTTP/1.0" html 1

You will start receiving messages that will indicate what is going on.

You can also try to capture a sniffer trace and see if the server respond correctly with the expected text.

Gilles.