はじめに
AIX の smit は 対話式のコマンド・インターフェースです。
コマンドが不明な場合でも smit 画面から操作を実行することが可能で、AIXの構築・設定場面で広く使われています。
System Management Interface Tool (SMIT)
システム管理インターフェース・ツール (SMIT) は、対話式で拡張可能な 画面指向のコマンド・インターフェースです。
# smit
System Management
Move cursor to desired item and press Enter.
[TOP]
Software Installation and Maintenance
Software License Management
Manage Editions
Devices
System Storage Management (Physical & Logical Storage)
Security & Users
Communications Applications and Services
Workload Partition Administration
Print Spooling
Advanced Accounting
Problem Determination
Manage the AIX Cryptographic Framework
Performance & Resource Scheduling
System Environments
Processes & Subsystems
[MORE...4]
smit (or smitty) コマンドのみの実行で SMIT TOP 画面が表示されますが、高速パス(FastPath) というパラメーターを付けて実行すると、smit の画面遷移を省略することが可能です。
smit は、ODM の sm_menu_opt オブジェクトが高速パス(FastPath)の情報を保持しています。
システム管理インターフェース・ツール (SMIT) の sm_menu_opt オブジェクトを使用すると、 smit コマンドで入力して SMIT を開始すると、ユーザーが特定のメニュー、セレクター、またはダイアログに直接アクセスできるファスト・パスを定義することができます。別名自体は表示されません。 ユーザーは高速パスを使用することによって、メインの SMIT メニューや、そのメニュー、セレクター、 またはダイアログへの SMIT インターフェース・パス内のその他のオブジェクトをバイパスすることができます。 任意の数の高速パスが同一のメニュー、セレクター、あるいはダイアログを指すことができます。
ODM の情報から smit の 高速パス(FastPath)を確認する方法を確認しました。
ODM とは、については以下をご参考ください。
環境
AIX 7.3 TL 1 SP 1
# oslevel -s
7300-01-01-2246
環境変数の設定
smit の sm_menu_opt オブジェクト・クラスは/usr/lib/objrepos で登録されているため、ODMDIR を /usr/lib/objrepos に設定します。
smit 関連 ODM オブジェクト・クラス(sm)の存在を /etc/objrepos と /usr/lib/objrepos で確認
# ls -l /etc/objrepos | grep sm
#
# ls -l /usr/lib/objrepos | grep sm
-rw-rw-r-- 1 root system 356352 Mar 06 2025 sm_cmd_hdr
-rw-rw-r-- 1 root system 729088 Mar 06 2025 sm_cmd_hdr.vc
-rw-rw-r-- 1 root system 2129920 Mar 06 2025 sm_cmd_opt
-rw-rw-r-- 1 root system 1077248 Mar 06 2025 sm_cmd_opt.vc
-rw-rw-r-- 1 root system 557056 Mar 06 2025 sm_menu_opt
-rw-rw-r-- 1 root system 122880 Mar 06 2025 sm_menu_opt.vc
-rw-rw-r-- 1 root system 106496 Mar 06 2025 sm_name_hdr
-rw-rw-r-- 1 root system 163840 Mar 06 2025 sm_name_hdr.vc
#
# echo $ODMDIR
/etc/objrepos
# export ODMDIR=/usr/lib/objrepos
# echo $ODMDIR
/usr/lib/objrepos
smit が使用する ODM オブジェクト・クラス
sm_menu_opt
sm_menu_opt オブジェクト・クラス の id が高速パスとして使用されています。
sm_menu_opt (SMIT メニュー) オブジェクト・クラス
https://www.ibm.com/docs/ja/aix/7.3.0?topic=smit-sm-menu-opt-menu-object-class
id
新規または別名の高速パスの ID または名前です。 id の値は最大長 64 文字の文字列です。 ID は、ユーザーのアプリケーションに対しても固有で、使用される SMIT データベース内 でも固有である必要があります。
AIX 7.3 TL1 SP1 では id は 2405 個存在していました。ただし 重複はあるようでした。
# odmget sm_menu_opt | grep ^[[:space:]]*'id =' | wc -l
2405
#
sm_menu_opt 最初の30行の確認。以下の構造です。
# odmget sm_menu_opt | head -n 30
sm_menu_opt:
id_seq_num = "010"
id = "chtz_date"
next_id = "date"
text = "Change / Show Date and Time"
text_msg_file = "smit.cat"
text_msg_set = 30
text_msg_id = 21
next_type = "d"
alias = ""
help_msg_id = "0421000"
help_msg_loc = ""
help_msg_base = ""
help_msg_book = ""
sm_menu_opt:
id_seq_num = "020"
id = "chtz_date"
next_id = "chtz_olson"
text = "Change Time Zone Using System Defined Values"
text_msg_file = "smit.cat"
text_msg_set = 30
text_msg_id = 32
next_type = "n"
alias = ""
help_msg_id = "0421001"
help_msg_loc = ""
help_msg_base = ""
help_msg_book = ""
/usr/lib/objrepos にあるオブジェクト・クラスより sm_menu_opt 以外にも高速パスとして使用されるオブジェクトクラス sm_cmd_hdr とsm_name_hdr が存在していることに気づきました。
sm_cmd_hdr
sm_cmd_hdr (SMIT ダイアログ・ヘッダー) オブジェクト・クラス
https://www.ibm.com/docs/ja/aix/7.3.0?topic=smits-sm-cmd-hdr-smit-dialog-header-object-class
id
オブジェクトの ID または名前。 id の値は最大長 64 文字の文字列です。 このidフィールドは、ダイアログに関連付けられたセレクターがない限り、ファスト・パス ID として使用できます。 ID はアプリケーション内で固有で、システム内でも固有である必要があります。
# odmget sm_cmd_hdr | grep ^[[:space:]]*'id =' | wc -l
1846
#
# odmget sm_cmd_hdr | head -n 30
sm_cmd_hdr:
id = "fsck"
option_id = "fsckOpts"
has_name_select = "n"
name = "Verify a File System"
name_msg_file = "smit.cat"
name_msg_set = 19
name_msg_id = 15
cmd_to_exec = "/usr/sbin/fsck -p"
ask = "n"
exec_mode = ""
ghost = ""
cmd_to_discover = ""
cmd_to_discover_postfix = ""
name_size = 0
value_size = 0
help_msg_id = "050601"
help_msg_loc = ""
help_msg_base = ""
help_msg_book = ""
sm_cmd_hdr:
id = "lsmount"
option_id = ""
has_name_select = "n"
name = "List All Mounted File Systems"
name_msg_file = "smit.cat"
name_msg_set = 19
name_msg_id = 40
sm_name_hdr
sm_name_hdr (SMIT セレクター・ヘッダー) オブジェクト・クラス
https://www.ibm.com/docs/ja/aix/7.3.0?topic=smits-sm-name-hdr-smit-selector-header-object-class
id
オブジェクトの ID または名前。 このidhas_name_select が以下のように設定されていない限り、フィールドをファスト・パス ID として外部化できます。"y"(はい)。 id の値は最大長 64 文字の文字列です。 ID はアプリケーション内で固有で、システム内でも固有である必要があります。
# odmget sm_name_hdr | grep ^[[:space:]]*'id =' | wc -l
656
#
# odmget sm_name_hdr | head -n 30
sm_name_hdr:
id = "crjfsstd"
next_id = "fcrfsCmdHdr"
option_id = "fcrfsNameOpt"
has_name_select = ""
name = "Add a Standard Journaled File System"
name_msg_file = "smit.cat"
name_msg_set = 19
name_msg_id = 452
type = "j"
ghost = "y"
cmd_to_classify = ""
cmd_to_classify_postfix = ""
raw_field_name = ""
cooked_field_name = ""
next_type = ""
help_msg_id = "050677"
help_msg_loc = ""
help_msg_base = ""
help_msg_book = ""
sm_name_hdr:
id = "crjfscomp"
next_id = "ccrfsCmdHdr"
option_id = "ccrfsNameOpt"
has_name_select = ""
name = "Add a Compressed Journaled File System"
name_msg_file = "smit.cat"
name_msg_set = 19
#
sm_cmd_opt (高速パスなし)
# odmget sm_cmd_opt | grep ^[[:space:]]*'id =' | wc -l
9139
sm_cmd_opt 内の id を指定したsmit 高速パスは、エラーメッセージとなりました。
# odmget sm_cmd_opt | grep ^[[:space:]]*'id =' | head
id = "fsckOpts"
id = "fsckOpts"
id = "fsckOpts"
id = "fsckOpts"
id = "mountOpts"
id = "mountOpts"
id = "mountOpts"
id = "mountOpts"
id = "mountOpts"
id = "mountOpts"
# smitty fsckOpts
┌──────────────────────────────────────────────────────────────────────────┐
│ ERROR MESSAGE │
│ │
│ Press Enter or Cancel to return to the │
│ application. │
│ │
│ 1800-007 There are currently no SMIT │
│ screen entries available for this FastPath. │
│ This FastPath may require installation of │
│ additional software before it can be accessed. │
│ │
│ F1=Help F2=Refresh F3=Cancel │
│ F8=Image F10=Exit Enter=Do │
└──────────────────────────────────────────────────────────────────────────┘
# odmget sm_cmd_opt | grep ^[[:space:]]*'id =' | more
sm_cmd_opt:
id_seq_num = "0"
id = "fsckOpts"
disc_field_name = ""
name = "NAME of file system\n\
-OR-"
name_msg_file = "smit.cat"
name_msg_set = 19
name_msg_id = 20
op_type = "l"
entry_type = ""
entry_size = 0
required = ""
prefix = "--"
cmd_to_list_mode = ""
cmd_to_list = "/usr/sbin/lsfs | awk 'NR > 1 && $6 != ro { print $3 }'"
cmd_to_list_postfix = ""
multi_select = ""
value_index = 0
disp_values = ""
values_msg_file = ""
values_msg_id = 0
aix_values = ""
help_msg_id = "050602"
help_msg_loc = ""
help_msg_base = ""
help_msg_book = ""
smit 高速パス 確認
上で表示された crjfsstd を使用して高速パスを確認します。
"name = "Add a Standard Journaled File System"" とあるので標準ジャーナル・ファイルシステムを追加するための高速パスと考えられます。
# smit crjfsstd
┌──────────────────────────────────────────────────────────────────────────┐
│ Volume Group Name │
│ │
│ Move cursor to desired item and press Enter. │
│ │
│ rootvg │
│ datavg │
│ │
│ F1=Help F2=Refresh F3=Cancel │
│ F8=Image F10=Exit Enter=Do │
│ /=Find n=Find Next │
└──────────────────────────────────────────────────────────────────────────┘
1回のコマンドで、ファイルシステムを追加するボリューム・グループの選択まで辿り着きました。
参考:よく使われるSMIT高速パス一覧
ご参考まで、よく使われる高速パスの参考一覧です。
| 用途・カテゴリ | 高速パス例 | 説明・備考 |
|---|---|---|
| システム環境 | smitty system | システム環境メニュー |
| smitty shutdown | システム停止 | |
| smitty chtz_date | 日付・時刻・タイムゾーン設定 | |
| smitty chgsys | システム特性の変更/表示 | |
| smitty logs | システムログ管理 | |
| smitty error | エラーログ(errpt)の管理 | |
| smitty dump | システムダンプの設定 | |
| ユーザー管理 | smitty security | セキュリティとユーザー管理メニュー |
| smitty users | ユーザー管理 | |
| smitty groups | グループ管理 | |
| smitty passwords | パスワード管理 | |
| ストレージ | smitty lv | 論理ボリューム管理 |
| smitty vg | ボリュームグループ管理 | |
| smitty fs | ファイルシステム管理 | |
| smitty mklvcopy | 論理ボリュームコピー作成 | |
| smitty syncvg | ボリュームグループ同期 | |
| ネットワーク | smitty chinet | NIC(ネットワーク・インターフェース)設定 |
| smitty inetalias | エイリアスアドレス設定 | |
| smitty mkroute | 静的経路追加 | |
| smitty hostname | ホスト名設定 | |
| smitty etherchannel | イーサチャネル設定 | |
| NFS | smitty nfs | NFSメニュー |
| smitty mknfs | NFS開始 | |
| smitty rmnfs | NFS停止 | |
| smitty mknfsexp | エクスポート・ディレクトリ追加 | |
| ソフトウェア管理 | smitty install | ソフトウェア・インストール |
| smitty install_latest | 最新パッケージ・インストール | |
| smitty update_all | 最新パッチ適用 | |
| 印刷 | smitty lssprt | プリンタ・リスト表示 |
| smitty qpri | 印刷ジョブ優先順位変更 | |
| クラスター | smitty hacmp | HACMP(高可用クラスター)メニュー |
| smitty clstart | クラスター・サービス開始 | |
| smitty clstop | クラスター・サービス停止 |
参考:smit の画面から高速パスを確認する方法
一般的に知られている smit の高速パスの確認方法では、対象のsmit 画面まで遷移して、F8 を押すと確認できます。
例) 下記では Install Software の smit 画面で、F8 を押します。
Install Software
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[TOP] [Entry Fields]
* INPUT device / directory for software .
* SOFTWARE to install [_all_latest] +
PREVIEW only? (install operation will NOT occur) no +
COMMIT software updates? yes +
SAVE replaced files? no +
AUTOMATICALLY install requisite software? yes +
EXTEND file systems if space needed? yes +
OVERWRITE same or newer versions? no +
VERIFY install and check file sizes? no +
Include corresponding LANGUAGE filesets? yes +
DETAILED output? no +
Process multiple volumes? yes +
ACCEPT new license agreements? no +
[MORE...11]
F1=Help F2=Refresh F3=Cancel F4=List
Esc+5=Reset F6=Command F7=Edit F8=Image
F9=Shell F10=Exit Enter=Do
PRINT SCREEN に Current fast path で "install_latest" が表示されます。
Install Software
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
[TOP] [Entry Fields]
* INPUT device / directory for software .
* SOFTWARE to install [_all_latest] +
PREVIEW only? (install operation will NOT occur) no +
COMMIT software updates? yes +
SAVE replaced files? no +
AUTOMATICA┌──────────────────────────────────────────────────────┐ +
EXTEND fil│ PRINT SCREEN │ +
OVERWRITE │ │ +
VERIFY ins│ Press Enter to save the screen image │ +
Include co│ in the log file. │ +
DETAILED o│ Press Cancel to return to the application. │ +
Process mu│ │ +
ACCEPT new│ Current fast path: │ +
[MORE...11] │ "install_latest" │
│ │
F1=Help │ F1=Help F2=Refresh F3=Cancel │
Esc+5=Reset │ F8=Image F10=Exit Enter=Do │
F9=Shell └──────────────────────────────────────────────────────┘
smitty install_latest を使用すると、この画面まで1回でたどり着くことが可能になります。
参考:smit と smitty の違い
smit と smitty はどちらも SMIT(System Management Interface Tool) を起動するコマンドですが、以下の違いがあります。
-
smit:自動的にグラフィカル/テキストモードを切り替えてSMITを起動
-
smitty:必ずテキストモードでSMITを起動
現場ではグラフィック端末でない場合の方が多いため smitty を使用するケースが多いと思います。
おわりに
AIX の設定手順を作る際に便利なsmit コマンドの高速パス(FastPath) の確認方法を確認しました。
ODM smit 関連オブジェクト・クラスの高速パス対象は数が多いため全てはリストしていませんが、smit 高速パスをより確認したい場合は、AIX 環境上でコマンドを実行いただき、対象をご確認ください。
以上です。