Cisco ACI のスイッチへ SSH アクセスした際にヘルプを表示したり、vsh を利用する方法についてメモします。
Tab x 2 でヘルプを表示する
スイッチにログインした場合、シェル上から ?
(クエスチョン)を入力してもそのまま「?」と表示されるだけで、一般的な IOS や NX-OS のようなヘルプは表示されません。
leaf# show ?
ヘルプを表示するには TAB
キーを 2 回、押します。
leaf# show [TAB][TAB]
aaa environment isis ospfv3 switchname
bfd fc2 istack port-channel system
bgp fcoe lacp porttrack tacacs-server
cdp fex lldp processes tech-support
clock flow locator-led radius-server tunnel
coop forwarding logging redundancy users
copp hardware mac resource vdc
copyright hostname mcp route-map version
cores hsrp mfdm routing vlan
dhcp interface module san-port-channel vpc
diagnostic inventory monitor service vrf
dpp ip npv snmp vsan
eigrp ipmgr ntp sprom zoning-filter
endpoint ipv6 oam stats_manager zoning-rule
vsh へログインする
vsh を使うと従来の NX-OS と同じインターフェイス(操作感)でコマンドを実行することが出来ます。 コマンドリファレンスには以下のように記載されています。
Virtual Shell (VSH or vshell), the traditional Cisco NX-OS switch interface, is not a supported mode for ACI. Limited VSH functionality is present for internal use by typing vsh in the iBash shell, but its use is not intended for normal operation. This guide does not describe VSH.
vsh へログインするには vsh
と入力するだけです。
leaf# vsh
Cisco iNX-OS Debug Shell
This shell should only be used for internal commands and exists
for legacy reasons. User should use ibash infrastructure as this
will be deprecated.
vsh にログインしても、プロンプトも変わず、見た目上は違いが分かりません。 しかし、vsh にログインしたことで操作感が従来の NX-OS に近づいており、例えば ?
を入力するとヘルプが表示されます。
leaf# show ?
bfd BFD commands
bgp Display BGP status and configuration
boot Show Bootvar Variables
cdp Show Cisco Discovery Protocol information
cli
cli Show CLI information
clock Display current Date
・
・
・
vsh へログインし、コマンドを実行する
vsh でコマンドを実行するには、「まず vsh へログインし」「コマンドを実行する」だけです。 以下の例では vsh へログインした後、show clock
で現在時刻を表示しています。
leaf# vsh
Cisco iNX-OS Debug Shell
This shell should only be used for internal commands and exists
for legacy reasons. User should use ibash infrastructure as this
will be deprecated.
leaf# show clock
01:19:14.111 JST Thu Apr 13 2017
vsh を終了するには exit
を実行します。 これで通常のシェルに戻りますが、見た目上は特に変わりません…
leaf# exit
leaf#
ワンライナーで vsh のコマンドを実行する
ワンライナーで vsh 上のコマンドを実行するには vsh -c "COMMAND"
を実行します。 vsh 上で show clock
を実行する場合は以下のようになります。 この場合は vsh 上でコマンド実行後、すぐに通常のシェルに戻ってきますので、vsh を抜ける (exit
を実行する) 必要がありません。
leaf# vsh -c "show clock"
01:22:00.171 JST Thu Apr 13 2017
コメント