Jump to content
Welcome to our new Citrix community!

callout configuration


Recommended Posts

Hello,

 

can a callout be setup to send a request to an external server ? in this specific case to www.google-analytics.com ?

 

I'm looking for a way to track hits for specific file types, so every time a request for a .ppt file comes in the callout would fire a request to google with that file information.

 

Thanks,

Link to comment
Share on other sites

yes, it can be done, however not an easy task if you are not familiar with callouts.

 

An HTTP callout is an HTTP or HTTPS request that the NetScaler appliance generates and sends to an external application when certain criteria are met during policy evaluation. The information that is retrieved from the server can be analyzed by default syntax policy expressions, and an appropriate action can be performed. You can configure HTTP callouts for HTTP content switching, TCP content switching, rewrite, responder, and for the token-based method of load balancing.

 

Before you configure an HTTP callout, you must set up an application on the server to which the callout will be sent. The application, which is called the HTTP callout agent , must be configured to respond to the HTTP callout request with the required information. The HTTP callout agent can also be a Web server that serves the data for which the NetScaler appliance sends the callout. You must make sure that the format of the response to an HTTP callout does not change from one invocation to another.

 

After you set up the HTTP callout agent, you configure the HTTP callout on the NetScaler appliance. Finally, to invoke the callout, you include the callout in a default syntax policy in the appropriate NetScaler feature and then bind the policy to the bind point at which you want the policy to be evaluated.

Link to comment
Share on other sites

Yes, you can configure an HTTP callout to an external server. You'd need to set up a virtual server that sends traffic to the external server (e.g. Google Analytics) and you could do this with a DNS based server and service. Make sure that your network configuration allows outbound requests to originate from the Netscaler. When your policy with the callout invocation is hit, the Netscaler will initiate an HTTP request to the external server.

Link to comment
Share on other sites

On 8/6/2018 at 1:10 PM, Ross Bender said:

Yes, you can configure an HTTP callout to an external server. You'd need to set up a virtual server that sends traffic to the external server (e.g. Google Analytics) and you could do this with a DNS based server and service. Make sure that your network configuration allows outbound requests to originate from the Netscaler. When your policy with the callout invocation is hit, the Netscaler will initiate an HTTP request to the external server.

 

Can you please detail virtual server (DNS based server and service) setup ?

 

Thanks

Link to comment
Share on other sites

1 hour ago, Daniel Nedelcu said:

 

Can you please detail virtual server (DNS based server and service) setup ?

 

Thanks

 

add server ga-server www.google-analytics.com
add service ga-service ga-server SSL 443 -gslb NONE -maxClient 0 -maxReq 0 -cip DISABLED -usip NO -useproxyport YES -sp ON -cltTimeout 180 -svrTimeout 360 -CKA NO -TCPB NO -CMP YES -appflowLog DISABLED
add lb vserver ga-callout HTTP 0.0.0.0 0 -persistenceType NONE -cltTimeout 180 -appflowLog DISABLED
bind lb vserver ga-callout ga-service

To be able to use a DNS based server, make sure you have a name server configured on the Netscaler (Traffic Management -> DNS).

 

Of course need to make sure your routing on the Netscaler is configured appropriately, and that your network configuration will allow requests from the Netscaler out of your network. But if you configure something similar, you'd be able to set up your callout to hit the virtual server.

  • Like 1
Link to comment
Share on other sites

 

add server ga-server www.google-analytics.com
add service ga-service ga-server SSL 443 -gslb NONE -maxClient 0 -maxReq 0 -cip DISABLED -usip NO -useproxyport YES -sp ON -cltTimeout 180 -svrTimeout 360 -CKA NO -TCPB NO -CMP YES -appflowLog DISABLED
add lb vserver ga-callout HTTP 0.0.0.0 0 -persistenceType NONE -cltTimeout 180 -appflowLog DISABLED
bind lb vserver ga-callout ga-service

 

I have created SRV, SVC, and VS

 

I'm getting "Undefined hits" only on the callout, can you please check my callout and policies maybe you can spot if there is an issue

 

Thanks

 

add policy httpCallout ga_test -vServer VS_GA_CALLOUT -returnType BOOL -hostExpr "\"www.google-analytics.com\"" -urlStemExpr "\"/collect\"\n" -headers X-Forwarded-For(client.ip.SRC) -parameters el(HTTP.REQ.URL) dl(HTTP.REQ.HOSTNAME) tid("UA-XXXXXX-1") ea(HTTP.REQ.URL.AFTER_STR(".")) t("event") ec("Downloads") -scheme http -resultExpr http.res.IS_VALID
add rewrite policy RW_POL_GA_ON_RES "http.REQ.URL.ENDSWITH_ANY(\"file_types\")&&http.RES.IS_SUCCESSFUL&&sys.HTTP_CALLOUT(ga_test)" NOREWRITE
add responder policy RES_POL_GA_ON_REQ "http.REQ.url.ENDSWITH_ANY(\"file_types\")&&sys.HTTP_CALLOUT(ga_test)" NOOP

 

Updates*

I made some changes and now I get hits under callout but nothing is recorder in ga, how can I see the HTTP request made from the callout  ?

 

 

Edited by Daniel Nedelcu
updates
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...