Question Mark(?) is not Supported in NetScaler CLI

Question Mark(?) is not Supported in NetScaler CLI

book

Article ID: CTX234965

calendar_today

Updated On:

Description

When running a command with question mark in the NetScaler CLI the question mark is removed.

Example command:
add lb monitor http-cmmvk-80 HTTP-ECV -send "GET /ConnectMVKWS_CancelBooking/mvkservice_CancelBooking?wsdl" -LRTM ENABLED -destPort 8080

If you copy and paste the above command in to a CLI session you will get the following result:
CLI1


If you run the same command via MAS or another automation tool the URL is set but it removes the "?" in the path.
However in MAS the report shows the right command with "?" but it is in fact set without it.

MAS Config Job report example:
MAS Report

NS GUI example after running the above job:
NSGUI
Notice that the "?" is missing from the config.

Adding the "?" via the GUI and the result from ns.log:
Mar 13 11:29:09 192.168.0.14 03/13/2018:10:29:09 GMT ns 0-PPE-0 : default GUI CMD_EXECUTED 739029 0 : User nsroot - Remote_ip 10.8.0.6 - Command "set lb monitor http-cmmvk-80 HTTP-ECV -send "GET /ConnectMVKWS_CancelBooking/mvkservice_CancelBooking?wsdl" -LRTM ENABLED -interval 5 SEC -resptimeout 2 SEC -resptimeoutThresh 0 -retries 3 -failureRetries 0 -alertRetries 0 -successRetries 1 -downTime 30 SEC -destPort 8080 -state ENABLED -reverse NO -transparent NO -ipTunnel NO -tos NO -secure NO -storefrontcheckbackendservices NO" - Status "Success" 

The same issue can be seen in other CLI commands like this for AppFW:
bind appfw profile Test2 -denyURL "^[^?]*/winnt/"

The commands with ? are stored in ns.conf as expected.

Resolution

There are two solutions:
1. "\" can be used to escape "?" in NetScaler CLI commands, like "\?".
2. Use NetScaler GUI to add the "?" character.


 

Problem Cause

It's the expected behavior from NetScaler CLI.