soymanue
Apr 18, 2013Nimbostratus
Sideband Connection Event Context
Hello
I need to call an external Web Service From APM to report a server that certain user is connected or disconnected.
I'm trying to do it with an iRule like this:
when RULE_INIT {
set servidor_destino "server.domain.int:7001"
set data "GET /RADIUS/rest/TLTF?name=mbm50002033 HTTP/1.0\r\n\r\n"
set conn [connect -timeout 1000 -idle 30 -status conn_status $servidor_destino]
if {$conn==""}{
log local0. "Conexion a Webservice fallida. No se puede conectar a $servidor_destino"
} else {
set send_info [send -timeout 3000 -status send_status $conn $data]
set rcv_data [recv -timeout 3000 -status recv_status 393 $conn]
log local0. "$data -> $rcv_data"
}
close $conn
}
When I try to save the iRule y get the error message :
"Command is not vallid in current event Context"
As I'm not applying the iRule to a Virtual Server, I think I can't use anything different from RULE_INIT line when HTTP_REQUEST o when CLIENT_ACCEPTED, can I?
Any idea?
Thank you