Utility Commands
2014-09-04 20:08:45 UTC
2014 Citrix Systems, Inc. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Contents
Utility Commands ............................................................................................. 3
nstrace............................................................................................. 4
scp.................................................................................................. 6
shell ................................................................................................ 7
install .............................................................................................. 8
grep ................................................................................................ 9
traceroute6 ....................................................................................... 11
traceroute......................................................................................... 13
ping6 ............................................................................................... 15
ping................................................................................................. 17
techsupport ....................................................................................... 19
callhome........................................................................................... 20
2
3
Utility Commands
This group of commands can be used to perform operations on the following entities:
nstrace
scp
shell
install
grep
traceroute6
traceroute
ping6
ping
techsupport
callhome
4
nstrace
nstrace
Synopsis
nstrace [-nf <positive_integer>] [-time <secs>] [-size <positive_integer>] [-mode <mode>
...] [-tcpdump ( ENABLED | DISABLED ) [-perNIC ( ENABLED | DISABLED )]] [-name <string>
[-id <string>]] [-filter <expression> [-link ( ENABLED | DISABLED )]]
Description
Invokes the nstrace program to log traffic flowing through the NetScaler appliance.
Parameters
h
prints this message - exclusive option
nf
Number of files to be generated in a single run of the command. Default value: 24
time
Number of seconds for which to log to trace file. Can be a mathematical expression. For
example, to log to trace files for 2 hours, you can specify 2*60*60. Default value: 3600
size
Size of the packet to be logged (should be in the range of 60 to 1514 bytes). Set to 0 for
full packet trace. Default value: 164 Maximum value: 1514
m
Capturing mode: sum of the values: 1 - Transmitted packets (TX) 2 - Packets buffered for
transmission (TXB) 4 - Received packets (RX) Default value: 6
tcpDump
Log files in TCP dump format (instead of nstrace format). Possible values: NSTRACE,
TCPDUMP
mode
Capturing mode for trace. Can be any of the following values, or a combination of these
values: * RX - Received packets before NIC pipelining * NEW_RX - Received packets after
NIC pipelining (packets that are not dropped) * TX - Transmitted packets * TXB - Packets
buffered for transmission * IPV6 - Translated IPv6 packets * C2C - Capture core-to-core
messages * NS_FR_TX - Flow receiver does not capture the TX/TXB packets. Applicable
only for a cluster setup. You can also provide a combination of modes. For example: *
-mode NEW_RX TXB: Capture RX packets after NIC handling and packets that are
buffered for actual transmission. * -mode RX TX: Capture packet during NIC pipeline
(filter expressions will not work for RX mode). * -mode NEW_RX TXB NS_FR_TX: Default
mode except that TX/TXB packets on the flow receiver are not captured. Default value:
DEFAULT_MODE
tcpdump
Log files format supported:nstrace-format, tcpdump-format. default:nstrace-format
Possible values: ENABLED, DISABLED Default value: DISABLED
name
Custom file name for nstrace files.
filter
Filter expression for nstrace. Maximum length of filter is 255 and it can be of the
following format: "<expression> [<relop> <expression>"] where, <relop> can be the && or
the || relational operators. <expression> is a string in the following format: <qualifier>
<operator> <qualifier-value> where, <operator> can be any one of the following (except
the commas): ==, eq, !=, neq, >, gt, <, lt, >=, ge, <=, le, BETWEEN Following are the
valid qualifiers for the command: SOURCEIP, SOURCEPORT, DESTIP, DESTPORT, IP, PORT,
SVCNAME, VSVRNAME, CONNID, VLAN, INTF. Example: nstrace -filter
"SOURCEIP==10.102.34.201 || SVCNAME !=s1 && SOURCEPORT >80"
Example
nstrace -nf 10 -time 100 -mode RX IPV6 TXB -name abc -tcpdump ENABLED -perNIC ENABLED
nstrace
5
6
scp
scp
Synopsis
scp [-r] [-C] [-q] <sourceString> <destString>
Description
Securely copies data from one computer to another, in SSH protocol.
Parameters
r
Recursively copy subdirectories.
C
Enable compression.
q
Quiet output. Disable the progress meter.
sourceString
Source user, host, and file path, specified as <user>@<host>:<path_to_copy_from>. The
user and host parts are optional.
destString
Destination user, host, and file path, specified as <user>@<host>:<path_to_copy_to>.
The user and host parts are optional.
Example
scp /nsconfig/ns.conf [email protected]:/nsconfig/
7
shell
shell
Synopsis
shell [(command)]
Description
Exits to the FreeBSD command prompt. Press Control + D or type exit to return to the
NetScaler command prompt. Note: The shell can be accessed only by users who have write
access to the NetScaler appliance.
Parameters
command
Shell command(s) to be invoked.
Example
> shell
# ps | grep nscli
485 p0 S 0:01.12 -nscli (nscli)
590 p0 S+ 0:00.00 grep nscli
# ^D Done
> shell ps -aux |grep nscli
485 p0 S 0:01.12 -nscli (nscli)
590 p0 S+ 0:00.00 grep nscli
8
install
install
Synopsis
install <url> [-c] [-y]
Description
Installs a version of NetScaler software on the system.
Parameters
url
http://[user]:[password]@host/path/to/file https://[user]:[password]@host/path/to/file
sftp://[user]:[password]@host/path/to/file scp://[user]:[password]@host/path/to/file
ftp://[user]:[password]@host/path/to/file file://path/to/file
c
Back up existing kernel.
y
Do not prompt for yes/no before rebooting.
Example
install http://host.netscaler.com/ns-6.0-41.2.tgz
9
grep
grep
Synopsis
grep [-c] [-E] [-i] [-v] [-w] [-x] <pattern>
Description
Searches files or output for lines containing a match to the specified <pattern>. By default,
grep prints the matching lines.
Parameters
c
Suppress normal output. Instead print a count of matching lines. With the -v option,
count non-matching lines.
E
Interpret <pattern> as an extended regular expression.
i
Ignore case distinctions.
v
Invert the sense of matching, to select non-matching lines.
w
Select only those lines containing matches that form whole words.
x
Select only those matches that exactly match the whole line.
pattern
The pattern (regular expression or text string) for which to search.
Example
show ns info | grep off -i
grep
10
11
traceroute6
traceroute6
Synopsis
traceroute6 [-n] [I] [-r] [-v] [-m <hoplimit>] [-p <port>] [-q <probes>] [-s <src_addr>] [-T
<td>] [-w <waittime>] <target> [<packetlen>]
Description
Invokes the UNIX traceroute6 command. Traceroute6 attempts to track the route that the
packets follow to reach the destination host.
Parameters
n
Print hop addresses numerically rather than symbolically and numerically.
I
Use ICMP ECHO for probes.
r
Bypass normal routing tables and send directly to a host on an attached network. If the
host is not on a directly attached network, an error is returned.
v
Verbose output. List received ICMP packets other than TIME_EXCEEDED and
UNREACHABLE.
m
Maximum hop value for outgoing probe packets. Default value: 64 Minimum value: 1
Maximum value: 255
p
Base port number used in probes. Default value: 33434 Minimum value: 1 Maximum
value: 65535
q
Number of probes per hop. Default value: 3 Minimum value: 1 Maximum value: 65535
s
Source IP address to use in the outgoing query packets. If the IP address does not belong
to this appliance, an error is returned and nothing is sent.
T
Traffic Domain Id Minimum value: 1 Maximum value: 4094
w
Time (in seconds) to wait for a response to a query. Default value: 5 Minimum value: 2
Maximum value: 86399
host
Destination host IP address or name.
packetlen
Length (in bytes) of the query packets. Default value: 44 Minimum value: 44 Maximum
value: 32768
Example
traceroute6 2002::7
traceroute6
12
13
traceroute
traceroute
Synopsis
traceroute [-S] [-n] [-r] [-v] [-M <min_ttl] [-m <max_ttl>] [-P <protocol>][-p <portno>] [-q
<nqueries>] [-s <src_addr>] [-T <td>] [-t <tos>] [-w <wait>] <host> [<packetlen>]
Description
Invokes the UNIX traceroute command. This command attempts to track the route that the
packets follow to reach the destination host.
Parameters
S
Print a summary of how many probes were not answered for each hop.
n
Print hop addresses numerically instead of symbolically and numerically.
r
Bypass normal routing tables and send directly to a host on an attached network. If the
host is not on a directly attached network, an error is returned.
v
Verbose output. List received ICMP packets other than TIME_EXCEEDED and
UNREACHABLE.
M
Minimum TTL value used in outgoing probe packets. Default value: 1 Minimum value: 1
Maximum value: 255
m
Maximum TTL value used in outgoing probe packets. Default value: 64 Minimum value: 1
Maximum value: 255
P
Send packets of specified IP protocol. The currently supported protocols are UDP and
ICMP.
p
Base port number used in probes. Default value: 33434 Minimum value: 1 Maximum
value: 65535
q
Number of queries per hop. Default value: 3 Minimum value: 1 Maximum value: 65535
s
Source IP address to use in the outgoing query packets. If the IP address does not belong
to this appliance, an error is returned and nothing is sent.
T
Traffic Domain Id Minimum value: 1 Maximum value: 4094
t
Type-of-service in query packets. Maximum value: 255
w
Time (in seconds) to wait for a response to a query. Default value: 5 Minimum value: 2
Maximum value: 86399
host
Destination host IP address or name.
packetlen
Length (in bytes) of the query packets. Default value: 44 Minimum value: 44 Maximum
value: 32768
Example
traceroute 10.102.4.107
traceroute
14
15
ping6
ping6
Synopsis
ping6 [-c <count>] [-i <interval>] [-I <interface>] [-n] [-p <pattern>] [-q] [-S sourceaddr] [-V
<vlanid>] [-T <td>] [-s <size>] Hostname
Description
Invokes the UNIX ping6 command. The hostName parameter must be used if the name is in
the /etc/hosts file directory or is otherwise known in DNS.
Parameters
c
Number of packets to send. The default value is infinite. Minimum value: 1 Maximum
value: 65535
i
Waiting time, in seconds. The default value is 1 second. Maximum value: 65535
I
Network interface on which to ping, if you have multiple interfaces.
n
Numeric output only. No name resolution.
p
Pattern to fill in packets. Can be up to 16 bytes, useful for diagnosing data-dependent
problems.
q
Quiet output. Only summary is printed.
s
Data size, in bytes. The default value is 56. Maximum value: 65507
V
VLAN ID for link local address. Minimum value: 1 Maximum value: 4094
S
Source IP address to be used in the outgoing query packets.
T
Traffic Domain Id Minimum value: 1 Maximum value: 4094
t
Timeout in seconds before ping6 exits
hostName
Address of host to ping.
Example
ping6 -p ff -I 1/1 -c 4 2002::1
ping6
16
17
ping
ping
Synopsis
ping [-c <count>] [-i <interval>] [-I <interface>] [-n] [-p <pattern>] [-q] [-s <size>] [-S
<src_addr>] [-T <td>] [-t <timeout>] <hostname>
Description
Invokes the UNIX ping command. The hostName parameter must be used if the name is in
the /etc/hosts file directory or is otherwise known in DNS.
Parameters
c
Number of packets to send. The default value is infinite. Minimum value: 1 Maximum
value: 65535
i
Waiting time, in seconds. The default value is 1 second. Maximum value: 65535
I
Network interface on which to ping, if you have multiple interfaces.
n
Numeric output only. No name resolution.
p
Pattern to fill in packets. Can be up to 16 bytes, useful for diagnosing data-dependent
problems.
q
Quiet output. Only the summary is printed.
s
Data size, in bytes. The default value is 56. Maximum value: 65507
S
Source IP address to be used in the outgoing query packets. If the IP addrESS does not
belongs to this appliance, an error is returned and nothing is sent.
T
Traffic Domain Id Minimum value: 1 Maximum value: 4094
t
Time-out, in seconds, before ping exits. Minimum value: 1 Maximum value: 3600
hostName
Address of host to ping.
Example
ping -p ff -c 4 10.102.4.107
ping
18
19
techsupport
show techsupport
Synopsis
show techsupport [-scope ( NODE | CLUSTER )]
Description
Generates a tar of system configuration data and statistics. This file must be submitted to
Citrix technical support with file name collector_<NS IP>_<P/S>_<DateTime>.tgz. The
archive is always pointed by the symbolic link /var/tmp/support/support.tgz for each
invocation of the command.
Parameters
scope
Use this option to run showtechsupport on present node or all cluster nodes. Possible
values: NODE, CLUSTER Default value: NS_TECH_NODE
Example
show techsupport
20
callhome
[ show | set | unset ]
show callhome
Synopsis
show callhome
Description
Displays the trigger events configured and the time when these events were triggered.
Example
show callhome
E-mail address configured:[email protected]
Trigger event State First occurrence Latest occurrence
------------- ----- ---------------- -----------------
1) Compact flash errors Enabled .. ..
2) Hard disk drive errors Enabled .. ..
3) Power supply unit failure Enabled 27 Aug 2010 18:22:47 28 Aug 2010 18:22:47
4) SSL card failure Enabled 25 Aug 2010 18:22:47 26 Aug 2010 18:22:47
5) Warm restart Enabled N/A ..
Top
set callhome
Synopsis
set callhome -emailAddress e-mailaddress
Description
Sets the contact person's E-mail address
Parameters
emailAddress
The contact person's E-mail address.
proxyMode
Deploy the callhome proxy mode Possible values: YES, NO Default value: NO
Example
set callhome -emailAddress [email protected]
Top
unset callhome
Synopsis
unset callhome [-emailAddress] [-proxyMode] [-IPAddress] [-port]
Description
Use this command to remove callhome settings.Refer to the set callhome command for
meanings of the arguments.
Top
callhome
21