Posts

Showing posts from March, 2013

Netscaler Nitro API, surge queues and servicegroup members

we just upgraded to 9.3 61.5 , and nitro changed , citrix call it 'tidying up', but all I can say is that not making your API backwards compatible in a minor release is bad bad bad. so, to get the service group members, their surge queue and other stats is now a multi step process poll the config , get the lb names, and the service groups bound call /nitro/v1/config/lbvserver  to get a list of vserver names call /nitro/v1/config/lbvserver_servicegroupmember_binding/{lbservername} to get list of members call /nitro/v1/stat/servicegroupmember?args=servicegroupname:{servicegroupname},serverName:{ip},port:{port}" suddenly a simple call is now N* bigger and more complex :-(

Mobile redirects and user agent device detection on a Netscaler

This is essential for integrated caching if you do redirects on apache/nginx based on mobile device etc. bind policy patset User_Agent_Mobile Blackberry -index 260 -charset ASCII bind policy patset User_Agent_Mobile iPod -index 200 -charset ASCII bind policy patset User_Agent_Mobile iPhone -index 220 -charset ASCII bind policy patset User_Agent_Mobile iPad -index 210 -charset ASCII bind policy patset User_Agent_Mobile Android -index 250 -charset ASCII   bind policy patset User_Agent_Desktop Linux -index 100 -charset ASCII bind policy patset User_Agent_Desktop Macintosh -index 120 -charset ASCII bind policy patset User_Agent_Desktop Windows -index 110 -charset ASCII add policy expression is_mobile_ua "HTTP.REQ.HEADER(\"User-Agent\").CONTAINS_INDEX(\"User_Agent_Mobile\").BETWEEN(200,299)" add policy expression is_desktop_ua "HTTP.REQ.HEADER(\"User-Agent\").CONTAINS_INDEX(\"User_Agent\").BETWEEN(100,199)"

GSLB on the netscaler

There are lots (and lots) of articles around GSLB, but none of them really worked for my brain.  I recently had to implement GSLB, to handle persistence of a java app between datacenters. The Scenario:  we have an internet java app in a datacenter, it uses jsession id's to track sessions.  We wanted to do active-active between our two datacenters, and have a big fat pipe between them . The solution: LB rules for jsession id persistence, like this  http://blogs.citrix.com/2010/05/06/complete-jsessionid-persistence-with-appexpert/ GSLB for site persistence using connection proxy to make it travel our pipes between dc The problems encountered. we use ultradns for managing dns load balancing and failover between our datacenters, this duplicates what gslb does, but we didn't want to open udp 53 to our dc.  this is slightly slower than using gslb and it has to wait for health checks and polling gslb is all about dns for failover, connection proxy is just for site pers

How to sync your keys to your server farm / clusters

you need sshpass and ssh-copy-id , then do; echo " StrictHostKeyChecking no" >> .ssh/config echo "UserKnownHostsFile = / dev / null" >> .ssh/config cat mylistofservers.txt | xargs -P10 -I {} sshpass -p 'mypassword' ssh-copy-id {}