【BIG-IP】よく使用するCLI コマンド Version: 16.1.2

BIG-IPのソフトウェアはRedHat系(CentOS)ベースで構成されています。通常のRedhat系ベースのbashに加え、BIG-IP専用の操作ができるTMOS(Traffic Management Operating System)という仕組みにより、BIG-IP専用のコマンドも実行できます。

この記事では、BIG-IPでよく使用するコマンドについて記事にします。

実際のコマンド出力のプロンプトは長いため、下記のとおり省略します。

表記省略(shellモード)
[admin@bigip-1:Active:Standalone] ~ #  → #
表記省略(tmshモード)
admin@(bigip-1)(cfg-sync Standalone)(Active)(/Common)(tmos)#  → (tmos)#
スポンサーリンク
  1. 基本操作
    1. shellモード
    2. tmshモード
    3. ページングの無効化(modify cli preference pager)
    4. 出力結果を条件によりフィルタ(grep)
  2. ヘルプ(help)
    1. Tabキー
    2. コマンドヘルプ(help)
  3. shellモード
    1. ネットワーク診断(ping / traceroute)
    2. IPv4アドレス表示(ip)
    3. パケット情報取得(tcpdump)
    4. ディレクトリ毎のディスク使用量(df)
    5. メモリの空き状態確認(free)
  4. 設定(create / delete / modify)
    1. 設定追加(create)
    2. 設定削除(delete)
    3. 設定変更(modify)
    4. 設定保存(save sys config)
  5. 設定情報(list)
    1. 稼働中の設定情報取得(list / show running-config )
    2. 特定モジュールの設定情報取得(list <modules>)
  6. ハードウェア情報
    1. バージョン情報(show sys version)
    2. ライセンス情報(show sys license)
    3. ハードウェア情報(show sys hardware )
  7. ネットワーク情報取得
    1. インタフェース情報取得(show net interface)
    2. ARPテーブル(show net arp)
    3. ルーティングテーブル(show net route)
  8. LTM情報
    1. ノード情報(show ltm node)
    2. プール情報(show ltm pool)
    3. 仮想サーバ情報(show ltm virtual)
    4. パーシステンス情報(show ltm persistence persist-records)
  9. パフォーマンス情報
    1. CPU情報(show sys cpu)
    2. メモリ情報(show sys memory)
    3. パフォーマンス情報(show sys performance system)
    4. スループット(show sys performance throughput)
    5. コネクション数(show sys performance connections)
    6. コネクション情報(show sys connection)
    7. リアルタイムの負荷状況(tmstat)
    8. リアルタイムのコネクション状況(bigtop)
  10. ログ情報
    1. ログ参照(show sys log)
    2. リアルタイムのログ参照(tail -f)
  11. 再起動・シャットダウン
    1. 再起動(reboot)
    2. シャットダウン(shutdown)

基本操作

shellモード

通常はbashコマンドが実行でき、下記のとおり、RedHat系ベースのOSで構成されていることが確認できます。

[admin@bigip-1:Active:Standalone] ~ # cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core)

tmshモード

BIG-IP専用の操作ができるTMOSを使用するには、tmshコマンドにより、tmsh モードへ移行します。tmshモードへ移行すると、(tmos)と表示されたプロンプトが変わります。tmshモードからshellモードへ移行するには、bashコマンドを実行します。

[admin@bigip-1:Active:Standalone] ~ # tmsh
admin@(bigip-1)(cfg-sync Standalone)(Active)(/Common)(tmos)# bash
[admin@bigip-1:Active:Standalone] ~ #

shellモードで、tmsh を先頭につけ、コマンドを実行することでも、tmshモードで実行できます。

[admin@bigip-1:Active:Standalone] ~ # tmsh show sys version

Sys::Version
Main Package
  Product     BIG-IP
  Version     16.1.2.1
  Build       0.0.10
  Edition     Point Release 1
  Date        Wed Dec 22 17:39:05 PST 2021

ページングの無効化(modify cli preference pager)

デフォルトでは、CLIの出力結果が長い場合、エンターキーでページ送りする必要があります。ページングを無効化したい場合は、tmshモードで、設定します。

(tmos)# modify cli preference pager disabled

無効化したページングを有効化します。

(tmos)# modify cli preference pager enabled

出力結果を条件によりフィルタ(grep)

出力結果をgrepで、条件に一致した行のみを抽出します。

(tmos)# show sys log ltm | grep  10.0.2.24
ltm 04-23 06:42:50 notice bigip-1.hirotanoblog.local mcpd[7278]: 
Node /Common/Web-01 address 10.0.2.24 monitor status up. [ /Common/icmp: up ]  
[ was up for 0hr:0min:56sec ] 
ltm 04-23 13:31:21 notice bigip-1.hirotanoblog.local mcpd[7311]: 
Node /Common/Web-01 address 10.0.2.24 monitor status down. [ /Common/icmp: down ]  
[ was up for 0hr:1min:11sec ] 
ltm 04-23 14:36:27 notice bigip-1.hirotanoblog.local mcpd[7304]: 
Node /Common/Web-01 address 10.0.2.24 monitor status down. [ /Common/icmp: down ]  
[ was up for 0hr:1min:8sec ] 
ltm 05-08 02:22:23 notice bigip-1.hirotanoblog.local mcpd[7276]: 
Node /Common/Web-01 address 10.0.2.24 monitor status up. [ /Common/icmp: up ]  
[ was up for 0hr:0min:49sec ]
スポンサーリンク

ヘルプ(help)

BIG-IPはコマンドのヘルプが充実しており、helpコマンドにより、入力可能なコマンドオプションや、コマンドのマニュアルページを参照することができます。

Tabキー

tmshモードにて コマンドの途中で、Tabキーを押すと、次に入力可能な値の一覧が表示されます。

(tmos)# show sys  TABキーを押す 
Options:
  current-module    recursive         |                 
Modules:
  alert             disk              icall             performance       software          
  crypto            dynad             ipfix             raid              turboflex         
  diags             fpga              nethsm            sflow             
Components:
  availability      fix-connection    ip-address        pptp-call-info    tmm-traffic       
  clock             ha-group          ip-stat           proc-info         traffic           
  cluster           ha-mirror         iprep-status      provision         ucs               
  config-diff       ha-status         license           pva-traffic       version           
  connection        hardware          log               ready             
  console           host-info         mac-address       service           
  cpu               hypervisor-info   mcp-state         sync-sys-files    
  failover          icmp-stat         memory            tmm-info

コマンドヘルプ(help)

helpコマンドにより、入力可能なコマンド(General、Command、Module、Utilities)の一覧が表示されます。

(tmos)# help Enterキーを押す 

Help is available on the following topics

General:       
  glob                     regex                        tmsh
  grep                     time                       

Commands:      
  cd                       load                         run
  cp                       modify                       save
  create                   mv                           send-mail
  delete                   publish                      show
  edit                     pwd                          shutdown
  exit                     quit                         start
  generate                 reboot                       stop
  help                     reset-stats                  submit
  install                  restart                      uninstall
  list                     revoke                     

Modules:
  auth
  cert-ldap                password-policy              source
  ldap                     radius                       tacacs
  login-failures           radius-server                user
  partition                remote-role                
  password                 remote-user
.
.

helpの後に、オプションをつけることで、コマンドのマニュアルなどを出力することができます。helpのあとに入力可能なコマンドをTabキーで確認します。

(tmos)# help  TABキーを押す 
Options:
  search        
Modules:
  auth          cm            mgmt          security      util          
  cli           ltm           net           sys           wom           
Commands:
  cd            exit          load          quit          run           start         
  cp            generate      modify        reboot        save          stop          
  create        help          mv            reset-stats   send-mail     submit        
  delete        install       publish       restart       show          uninstall     
  edit          list          pwd           revoke        shutdown      
General:
  glob          grep          regex         time          tmsh

例えば、help show を実行すると、show コマンドのマニュアルが出力されます。

(tmos)# help show Enterキーを押す
show(1)                                                                BIG-IP TMSH Manual                                                                show(1)

NAME
       show command - Displays statistics for and the status of specified
       components.

MODULE
       All tmsh modules.

SYNTAX
       Use the show command within a tmsh module to display statistics for and
       the status of components in that module. To display statistics for and
       the status of components in another module, use the full path to the
       component.

        show
        show [component]
        show [component] [name]
        show / [module] [component] [name]
          options:
            all-stats
            current-module
            (default | exa | gig | kil | meg | peta | raw | tera | yotta | zetta)
            (detail | global | historical)
            field-fmt
            running-config
            recursive
.
.

helpコマンドの詳細は下記を参考にしてください。

  >> 参考記事 :  K20393414: Using the tmsh Help feature
myF5
スポンサーリンク

shellモード

shellモードでは、通常のRedHatのコマンドが使用できます。

ネットワーク診断(ping / traceroute)

# ping www.google.com
PING www.google.com (142.251.42.132) 56(84) bytes of data.
64 bytes from nrt12s45-in-f4.1e100.net (142.251.42.132): icmp_seq=1 ttl=103 time=1.20 ms
64 bytes from nrt12s45-in-f4.1e100.net (142.251.42.132): icmp_seq=2 ttl=103 time=1.35 ms
64 bytes from nrt12s45-in-f4.1e100.net (142.251.42.132): icmp_seq=3 ttl=103 time=1.14 ms
64 bytes from nrt12s45-in-f4.1e100.net (142.251.42.132): icmp_seq=4 ttl=103 time=1.32 ms
^C
--- www.google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 1.149/1.257/1.358/0.091 ms
# traceroute www.google.com
traceroute to www.google.com (142.251.42.132), 30 hops max, 60 byte packets
 1  54.150.128.93 (54.150.128.93)  1.448 ms 54.150.128.93 (54.150.128.81)  7.486 ms 54.150.128.93 (54.150.128.19)  100.765 ms
 2  100.65.27.0 (100.65.27.0)  6.879 ms 100.65.26.160 (100.65.26.160)  7.739 ms 100.65.27.144 (100.65.27.144)  5.662 ms
 3  100.66.12.190 (100.66.12.190)  5.378 ms 100.66.12.90 (100.66.12.90)  7.664 ms 100.66.12.216 (100.66.12.216)  1.828 ms
 4  100.66.15.160 (100.66.15.160)  27.006 ms 100.66.14.232 (100.66.14.232)  59.029 ms 100.66.14.100 (100.66.14.100)  18.188 ms
・・・

IPv4アドレス表示(ip)

自身に付与されているIPアドレスを表示します。

# ip -f inet addr show        
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    inet 127.0.0.1/24 scope host lo
       valid_lft forever preferred_lft forever
    inet 127.2.0.2/24 brd 127.2.0.255 scope host lo:1
       valid_lft forever preferred_lft forever
4: mgmt:  mtu 9001 qdisc noqueue state UP qlen 1000
    inet 10.0.0.201/24 brd 10.0.0.255 scope global mgmt
       valid_lft forever preferred_lft forever
6: tmm:  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    inet 127.1.1.254/24 brd 127.1.1.255 scope global tmm
       valid_lft forever preferred_lft forever
8: tmm_bp:  mtu 4096 qdisc pfifo_fast state UP qlen 1000
    inet 127.20.0.254/16 brd 127.20.255.255 scope global tmm_bp
       valid_lft forever preferred_lft forever
10: external:  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    inet 10.0.1.201/24 brd 10.0.1.255 scope global external
       valid_lft forever preferred_lft forever

パケット情報取得(tcpdump)

下記の例では、インタフェース(external)上を流れる宛先10.0.2.24 の通信をキャプチャしています。

# tcpdump -i  external dst 10.0.2.24
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on external, link-type EN10MB (Ethernet), capture size 65535 bytes
12:09:26.168146 IP bigip-1.hirotanoblog.local.42231 > 10.0.2.24.http: Flags [S], seq 2938028730, win 29200, options [mss 1460,sackOK,TS val 2711924503 ecr 0,nop,wscale 7], length 0 out slot1/tmm0 lis= port=1.1 trunk=
12:09:26.168752 IP bigip-1.hirotanoblog.local.42231 > 10.0.2.24.http: Flags [.], ack 1526192312, win 229, options [nop,nop,TS val 2711924504 ecr 690302613], length 0 out slot1/tmm0 lis= port=1.1 trunk=
12:09:26.168766 IP bigip-1.hirotanoblog.local.42231 > 10.0.2.24.http: Flags [P.], seq 0:9, ack 1, win 229, options [nop,nop,TS val 2711924504 ecr 690302613], length 9: HTTP: GET / out slot1/tmm0 lis= port=1.1 trunk=
12:09:26.193216 IP bigip-1.hirotanoblog.local.42231 > 10.0.2.24.http: Flags [.], ack 1449, win 251, options [nop,nop,TS val 2711924528 ecr 690302637], length 0 out slot1/tmm0 lis= port=1.1 trunk=
12:09:26.193240 IP bigip-1.hirotanoblog.local.42231 > 10.0.2.24.http: Flags [.], ack 2897, win 274, options [nop,nop,TS val 2711924528 ecr 690302637], length 0 out slot1/tmm0 lis= port=1.1 trunk=

ディレクトリ毎のディスク使用量(df)

オプション”-h”によりディスク容量をMB/GB単位で出力します。

# df -h
Filesystem                             Size  Used Avail Use% Mounted on
/dev/mapper/vg--db--vda-set.1.root     419M  246M  147M  63% /
devtmpfs                               3.9G  4.0K  3.9G   1% /dev
tmpfs                                  3.9G  2.3M  3.9G   1% /dev/shm
tmpfs                                  3.9G  2.2M  3.9G   1% /run
tmpfs                                  3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/mapper/vg--db--vda-set.1._usr     5.7G  4.5G  841M  85% /usr
/dev/mapper/vg--db--vda-set.1._var     1.5G  367M 1021M  27% /var
/dev/mapper/vg--db--vda-set.1._config  469M   14M  427M   4% /config
prompt                                 4.0M   28K  4.0M   1% /var/prompt
/dev/mapper/vg--db--vda-dat.appdata     31M  4.5M   25M  16% /appdata
none                                   3.9G   18M  3.9G   1% /var/tmstat
/dev/mapper/vg--db--vda-dat.share       15G  135M   14G   1% /shared
none                                   3.9G   33M  3.9G   1% /shared/rrd.1.2
/dev/mapper/vg--db--vda-dat.log        969M   37M  867M   4% /var/log
none                                   3.9G     0  3.9G   0% /var/loipc
tmpfs                                  799M     0  799M   0% /run/user/91
tmpfs                                  799M     0  799M   0% /run/user/0

メモリの空き状態確認(free)

オプション”-t”によりswapを含めた総量も表示します。

# free -t
              total        used        free      shared  buff/cache   available
Mem:        8175052     7752116       74736       57264      348200       53256
Swap:       1023996      327680      696316
Total:      9199048     8079796      771052
スポンサーリンク

設定(create / delete / modify)

設定追加(create)

新しく設定を追加する場合は、create コマンドを使用します。下記は、負荷分散で使用するノード、プール、仮想サーバを新規追加する際のコマンド例です。

ノード名;Web-03 、IPアドレス:10.0.2.123 を追加
(tmos)# create ltm node Web-03 address 10.0.2.123
ノード名:Web-03(80番ポート)をメンバーにしたプール:Web-Pool-1を追加
(tmos)# create ltm pool Web-Pool-1 members add  { Web-03:80 } 
プール:Web-Pool-1に対する仮想アドレス:Web-VS-1を追加
(tmos)# create ltm virtual Web-VS-1 destination 10.0.1.245:http ip-protocol tcp

設定削除(delete)

設定を削除する際に、deleteコマンドを使用します。上で設定したノード、プール、仮想サーバを削除するコマンド例です。

仮想アドレス:Web-VS-1を削除
(tmos)# delete ltm virtual Web-VS-1 
プール:Web-Pool-1を削除
(tmos)# delete ltm pool Web-Pool-1
ノード:Web-03を削除
(tmos)# delete ltm node Web-03

設定変更(modify)

設定を変更する際に、modifyコマンドを使用します。下記は、ホスト名をbigip-1.hirotanoblog.work から bigip-2.hirotanoblog.work に変更します。

現在のホスト名を確認
(tmos)# list sys global-settings 
sys global-settings {
    gui-setup disabled
    hostname bigip-1.hirotanoblog.work
}
ホスト名を変更
(tmos)# modify sys global-settings hostname bigip-2.hirotanoblog.work 
(tmos)#
ホスト名が変更されていることを確認
(tmos)# list sys global-settings  
sys global-settings {
    gui-setup disabled
    hostname bigip-2.hirotanoblog.work
}

設定保存(save sys config)

GUIで設定変更した場合は、設定変更時に自動的に起動時の設定として保存されますが、CLIで設定変更した場合、自動では起動時の設定として保存されません。そのため、CLIで設定変更した場合は、save sys config で設定保存する必要があります。

(tmos)# save sys config
Saving running configuration...
  /config/bigip.conf
  /config/bigip_base.conf
  /config/bigip_user.conf
Saving Ethernet map ...done
Saving PCI map ...
 - verifying checksum .../var/run/f5pcimap: OK
done
 - saving ...done
(tmos)#
スポンサーリンク

設定情報(list)

設定情報を表示するには、list コマンドを使用します。設定情報がそのまま表示されます。

稼働中の設定情報取得(list / show running-config )

list コマンドで、現在の稼働中の設定情報が取得できます。

(tmos)# list
Display all 188 items? (y/n) y
auth password-policy { }
auth remote-role { }
auth remote-user { }
auth source { }
auth user admin {
    description "Admin User"
.
.

同様の設定情報は、show running-config でも取得できます。

(tmos)# show running-config
Display all 188 items? (y/n) y
auth password-policy { }
auth remote-role { }
auth remote-user { }
auth source { }
auth user admin {
    description "Admin User"
.
.

デフォルト値も表示する場合は、オプション all-properties を使用します。

(tmos)# list all-properties 
Display all 188 items? (y/n) y
auth password-policy {
    description none
    expiration-warning 7
    lockout-duration 0
    max-duration 99999
    max-login-failures 0
    min-duration 0
.
.

特定モジュールの設定情報取得(list <modules>)

モジュール単位で、設定情報を参照することもできます。下記は、ltm関連の設定を参照する場合のコマンド例です。

(tmos)# list ltm
ltm default-node-monitor {
    rule none
}
ltm dns analytics global-settings { }
ltm dns cache global-settings { }
ltm global-settings connection { }
ltm global-settings general {
    share-single-mac vmw-compat
}
ltm global-settings rule { }
ltm global-settings traffic-control { }
ltm nat NATLIST-1 {
    inherited-traffic-group true
    originating-address 10.0.2.24
    traffic-group traffic-group-1
    translation-address 10.0.1.101
}
ltm node Web-01 {
    address 10.0.2.24
    monitor icmp
    session monitor-enabled
    state up
}
.
.
スポンサーリンク

ハードウェア情報

ハードウェア状態やコネクション数など、稼働状態を参照するのに、show コマンドを使用します。

バージョン情報(show sys version)

OS情報が確認できます。

(tmos)# show sys version 
Sys::Version
Main Package
  Product     BIG-IP
  Version     16.1.2.1
  Build       0.0.10
  Edition     Point Release 1
  Date        Wed Dec 22 17:39:05 PST 2021

ライセンス情報(show sys license)

現在のライセンス情報(Registration keyなど)を確認できます。

(tmos)# show sys license
Sys::License
Licensed Version                 14.0.0
Registration key                 XXXXX-XXXXX-XXXXX-XXXXX-XXXXXX
Licensed On                      2017/09/25
Service Check Date               2017/09/22
Platform ID                      Z100a_pc
Daily Renewal Notification Days  5
・
・

ハードウェア情報(show sys hardware )

ハードウェア情報、シリアル番号など確認できます。

(tmos)# show sys hardware 
Sys::Hardware
Chassis Information
  Maximum MAC Count  1
  Registration Key   -

Hardware Version Information
  Name        cpus        
  Type        base-board  
  Model       Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
  Parameters  --            --
              cache size    46080 KB
              cores         2  (physical:1)
              cpu MHz       2300.088
              cpu sockets   1
              cpu stepping  1
            
Platform
  Name  BIG-IP Virtual Edition
  BIOS Revision   
  Base MAC       xx:xx:xx:xx:xx:xx
  Hypervisor     HVM domU
  Cloud          AWS

System Information         
  Type                       Z100
  Chassis Serial             xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx
  Level 200/400 Part          
  Switchboard Serial          
  Switchboard Part Revision   
  Host Board Serial           
  Host Board Part Revision
スポンサーリンク

ネットワーク情報取得

インタフェース情報取得(show net interface)

インタフェースの送受信トラフィック量、速度、デュプレックス、エラーカウントを確認できます。

(tmos)# show net interface

------------------------------------------------------------------
Net::Interface
Name  Status    Bits    Bits   Pkts   Pkts  Drops  Errs      Media
                  In     Out     In    Out                        
------------------------------------------------------------------
1.1       up  429.2M   94.2M  59.2K  62.3K      0     0  10000T-FD
mgmt      up   43.7M  180.5M  33.4K  32.8K      0     0   100TX-FD

ARPテーブル(show net arp)

(tmos)# show net arp
--------------------------------------------------------------------------------
Net::Arp
Name      Address   HWaddress          Vlan              Expire-in-sec  Status
--------------------------------------------------------------------------------
10.0.1.1  10.0.1.1  06:bd:46:50:67:6f  /Common/external  259            resolved

ルーティングテーブル(show net route)

(tmos)# show net route                  
----------------------------------------------------------------------------------
Net::Routes       
Name                Destination         Type       NextHop               Origin
----------------------------------------------------------------------------------
default-gw          default             gw         10.0.1.1              static
127.20.0.0/16       127.20.0.0/16       interface  tmm_bp                connected
10.0.1.0/24         10.0.1.0/24         interface  /Common/external      connected
127.1.1.0/24        127.1.1.0/24        interface  tmm                   connected
.
.
スポンサーリンク

LTM情報

ノード情報(show ltm node)

ノード毎の状態、トラフィック量、コネクション数などを表示します。

(tmos)# show ltm node
------------------------------------------
Ltm::Node: Web-01 (10.0.2.24)
------------------------------------------
Status               
  Availability   : available
  State          : enabled
  Reason         : Node address is available
  Monitor        : icmp
  Monitor Status : up
  Session Status : enabled
                     
Traffic                ServerSide  General
  Bits In                    1.2M        -
  Bits Out                  64.4M        -
  Packets In                 2.3K        -
  Packets Out                6.7K        -
  Current Connections           0        -
  Maximum Connections           2        -
  Total Connections           282        -
  Total Requests                -      288
  Current Sessions              -        0
.
.

プール情報(show ltm pool)

プールの状態、トラフィック量(サーバサイド)、コネクション数などを表示します。

(tmos)# show ltm pool
---------------------------------------------------------------------------------------
Ltm::Pool: Web-Pool                                      
---------------------------------------------------------------------------------------
Status                                                   
  Availability           : available                     
  State                  : enabled                       
  Reason                 : The pool is available         
  Monitor                : http                          
  Minimum Active Members : 0                             
  Priority Groups        : 0/0/0 (highest/current/lowest)
  Current Active Members : 2                             
  Available Members      : 2                             
  Total Members          : 2                             
  Total Requests         : 1153                          
  Current Sessions       : 0                             
                                                         
Traffic                                                    ServerSide
  Bits In                                                        5.2M
  Bits Out                                                     303.7M
  Packets In                                                    10.2K
  Packets Out                                                   30.9K
  Current Connections                                               0
  Maximum Connections                                               7
  Total Connections                                              1.1K
                                                         
Connection Queue                                                 Pool  Pool and members
  Number of connections queued now                                  0                 0
  Number of connections serviced                                    0                 0
  Queue head entry age (ms)                                         0                 0
  Maximum queue entry age ever (ms)                                 0                 0
  Maximum queue entry age recently (ms)                             0                 0
  Average queue entry age (ms)                                      0                 0
                                                         
Message Routing Framework                                          In               Out
  Message                                                           0                 0
  Request                                                           0                 0
  Response                                                          0                 0

仮想サーバ情報(show ltm virtual)

仮想サーバの状態、トラフィック量(クライアントサイド)、コネクション数などを表示します。

(tmos)# show ltm virtual
------------------------------------------------------------------
Ltm::Virtual Server: Web-VS    
------------------------------------------------------------------
Status                         
  Availability     : available 
  State            : enabled   
  Reason           : The virtual server is available
  CMP              : enabled   
  CMP Mode         : all-cpus  
  Destination      : 10.0.1.100:80
                               
Traffic                             ClientSide  Ephemeral  General
  Bits In                                 7.5M          0        -
  Bits Out                              308.7M          0        -
  Packets In                             15.5K          0        -
  Packets Out                            33.9K          0        -
  Current Connections                        0          0        -
  Maximum Connections                        6          0        -
  Total Connections                       1.1K          0        -
  Evicted Connections                        0          0        -
  Slow Connections Killed                    0          0        -
  Min Conn Duration/msec                     -          -      201
  Max Conn Duration/msec                     -          -   192.6K
  Mean Conn Duration/msec                    -          -      500
  Total Requests                             -          -     1.1K
                               
SYN Cookies                    
  Status                         not-activated
  Hardware SYN Cookie Instances              0
  Software SYN Cookie Instances              0
  Current SYN Cache                          0
  SYN Cache Overflow                         0
  Total Software                             0
  Total Software Accepted                    0
  Total Software Rejected                    0
  Total Hardware                             0
  Total Hardware Accepted                    0
                               
Message Routing Framework                   In        Out
  Message                                    0          0
  Request                                    0          0
  Response                                   0          0
                               
CPU Usage Ratio (%)            
  Last 5 Seconds                             0
  Last 1 Minute                              0
  Last 5 Minutes                             0

パーシステンス情報(show ltm persistence persist-records)

送信元IPアドレスによるパーシステンス情報を表示します。

(tmos)# show ltm persistence persist-records 
Sys::Persistent Connections
source-address  60.64.20.190  10.0.1.100:80  10.0.2.24:80  (tmm: 1)
Total records returned: 1
スポンサーリンク

パフォーマンス情報

CPU情報(show sys cpu)

CPU使用率を表示します。

(tmos)# show sys cpu

Sys::System CPU Information
-------------------------------------------------------------------
System CPU Usage(%)  Current  Average  Max(since 05/08/22 11:01:34)
-------------------------------------------------------------------
Utilization               51        3                           100
.
.

メモリ情報(show sys memory)

メモリ使用率を表示します。

(tmos)# show sys memory
Sys::System Memory Information
-----------------------------------------------------------------
Memory Used(%)     Current  Average  Max(since 05/08/22 11:03:23)
-----------------------------------------------------------------
TMM Memory Used          3        3                             3
Other Memory Used       80       80                            83
Swap Used               31       25                            31
.
.

パフォーマンス情報(show sys performance system)

CPU/メモリ使用率を表示します。

(tmos)# show sys performance system 

Sys::Performance System
-------------------------------------------------------------------
System CPU Usage(%)  Current  Average  Max(since 05/08/22 11:42:53)
-------------------------------------------------------------------
Utilization                1        2                            58
                   
-------------------------------------------------------------------
Memory Used(%)       Current  Average  Max(since 05/08/22 11:42:53)
-------------------------------------------------------------------
TMM Memory Used            3        3                             3
Other Memory Used         80       80                            84
Swap Used                 40       28                            40

スループット(show sys performance throughput)

スループット情報(秒間あたりのトラフィック量など)を表示します。

(tmos)# show sys performance throughput

Sys::Performance Throughput
-----------------------------------------------------------------------------
Throughput(bits)(bits/sec)     Current  Average  Max(since 05/08/22 11:43:26)
-----------------------------------------------------------------------------
Service                          29.5K    29.7K                         50.9K
In                               27.8K    28.2K                         48.7K
Out                               2.1K     2.2K                         14.4K                             
-----------------------------------------------------------------------------
SSL Transactions               Current  Average  Max(since 05/08/22 11:43:26)
-----------------------------------------------------------------------------
SSL TPS                              0        0                             0                             
-----------------------------------------------------------------------------
Throughput(packets)(pkts/sec)  Current  Average  Max(since 05/08/22 11:43:26)
-----------------------------------------------------------------------------
Service                              8        8                            16
In                                   4        4                             9
Out                                  4        4                            10

コネクション数(show sys performance connections)

アクティブコネクション数、新規接続コネクション数(/秒)、HTTPリクエスト数を確認できます。

(tmos)# show sys performance connections

Sys::Performance Connections
---------------------------------------------------------------------------
Active Connections           Current  Average  Max(since 05/08/22 11:52:17)
---------------------------------------------------------------------------
Connections                        6        5                            61                           
---------------------------------------------------------------------------
Total New Connections(/sec)  Current  Average  Max(since 05/08/22 11:52:17)
---------------------------------------------------------------------------
Client Connections                 2        1                             6
Server Connections                 2        1                             6                           
---------------------------------------------------------------------------
HTTP Requests(/sec)          Current  Average  Max(since 05/08/22 11:52:17)
---------------------------------------------------------------------------
HTTP Requests                      1        0                             1

コネクション情報(show sys connection)

コネクション情報(送信元、宛先のIPアドレス、ポート番号)を確認できます。

(tmos)# show sys connection
Really display 1000 connections? (y/n) y
Sys::Connections
10.0.1.201:5623  10.0.2.71:8  10.0.1.201:63070  10.0.2.71:8   icmp  1  (tmm: 1)  none  none
any6.any         any6.any     10.0.1.201:54398  10.0.2.71:80  tcp   2  (tmm: 1)  none  none
10.0.1.201:5622     10.0.2.24:8    10.0.1.201:16495  10.0.2.24:8   icmp  3   (tmm: 0)  none  none
10.0.1.201:5618     10.0.2.24:8    10.0.1.201:47359  10.0.2.24:8   icmp  13  (tmm: 0)  none  none
60.64.20.190:54391  10.0.1.100:80  any6.any          any6.any      tcp   5   (tmm: 0)  none  none
60.64.20.190:54392  10.0.1.100:80  10.0.1.201:54392  10.0.2.71:80  tcp   3   (tmm: 0)  none  none
10.0.1.201:5620  10.0.2.24:8  10.0.1.201:5620  10.0.2.24:8  icmp  8  (tmm: 0)  none  none
10.0.1.201:5621  10.0.2.71:8  10.0.1.201:5621  10.0.2.71:8  icmp  6  (tmm: 1)  none  none
Total records returned: 8

show sys connection の見方は、NATの動作確認の記事で、まとめていますので、参考にしてください。

  >> 参考記事 :  アドレス変換(NAT) と動作確認

リアルタイムの負荷状況(tmstat)

CPU・メモリ使用状況をリアルタイムで表示します。

# tmstat

実行すると、下記画面となり、値が自動更新されます。Ctrl + C で表示を停止します。

リアルタイムのコネクション状況(bigtop)

トラフィック量、コネクション数をリアルタイムに表示します。仮想サーバ、ノード単位で、表示されます。

# bigtop

実行すると、下記画面となり、値が自動更新されます。Ctrl + C で表示を停止します。

リアルタイムではなく、一度だけ表示したい場合は、-once オプションを使用します。

# bigtop -once
                         |  bits  since       |  bits  in prior    |  current
                         |  May  8 11:20:38   |  0 seconds         |  time
BIG-IP      ACTIVE       |---In----Out---Conn-|---In----Out---Conn-|  16:01:32
bigip-1.hirotanoblog.work 44.16M 925.2M  15394      0      0      0
                         
VIRTUAL ip:port          |---In----Out---Conn-|---In----Out---Conn-|-Nodes Up--
/Common/10.0.1.100:http   11.65M 465.5M   1851      0      0      0      2
                         
NODE ip:port             |---In----Out---Conn-|---In----Out---Conn-|--State----
/Common/Web-01:http       4.343M 234.0M   1021      0      0   1021 UP
/Common/Web-02:http       3.929M 232.8M    827      0      0    827 UP
スポンサーリンク

ログ情報

ログ参照(show sys log)

show sys log でログ情報を取得できます。取得できるログは下記のドキュメントを参照してください。

  >> 参考記事 :  K16197: Reviewing BIG-IP log files
myF5

例えば、LTM関連のログを参照する際は、show sys log ltm を実行します。

(tmos)# show sys log ltm

ltm 05-08 02:22:23 notice bigip-1.hirotanoblog.local mcpd[7276]: Virtual Address /Common/10.0.1.100 general status changed from BLUE to GREEN. 
ltm 05-08 02:22:23 notice bigip-1.hirotanoblog.local mcpd[7276]: SNMP_TRAP: Virtual /Common/Web-VS has become available 
ltm 05-08 02:22:23 notice bigip-1.hirotanoblog.local mcpd[7276]: Pool /Common/Web-Pool member /Common/Web-02:80 monitor status up. [ /Common/http: up ]  [ was up for 0hr:0min:49sec ] 
ltm 05-08 02:22:23 notice bigip-1.hirotanoblog.local mcpd[7276]: Pool /Common/Web-Pool member /Common/Web-01:80 monitor status up. [ /Common/http: up ]  [ was up for 0hr:0min:49sec ] 
ltm 05-08 02:22:23 notice bigip-1.hirotanoblog.local mcpd[7276]: Node /Common/Web-02 address 10.0.2.71 monitor status up. [ /Common/icmp: up ]  [ was up for 0hr:0min:49sec ] 
ltm 05-08 02:22:23 notice bigip-1.hirotanoblog.local mcpd[7276]: Node /Common/Web-01 address 10.0.2.24 monitor status up. [ /Common/icmp: up ]  [ was up for 0hr:0min:49sec ]

リアルタイムのログ参照(tail -f)

各種ログは、デフォルトで、/var/log 配下に保存されます。リアルタイムでログ表示するには、tail -f で該当のログファイルを参照します。

例えば、LTM関連のログは /var/log/ltm に保存されます。

# tail -f /var/log/ltm
May  8 15:20:29 bigip-1.hirotanoblog.local notice mcpd[7276]: 01070640:5: Node /Common/Web-02 address 10.0.2.71 monitor status down. [ /Common/icmp: down ]  [ was up for 0hr:6mins:33sec ]
May  8 15:20:29 bigip-1.hirotanoblog.local notice mcpd[7276]: 01070638:5: Pool /Common/Web-Pool member /Common/Web-02:80 monitor status down. [ /Common/http: down; last error:  ]  [ was up for 0hr:6mins:33sec ]
スポンサーリンク

再起動・シャットダウン

再起動(reboot)

reboot コマンドにより再起動します。

(tmos)# reboot
The system will be rebooted momentarily

シャットダウン(shutdown)

shutdown コマンドにより機器を停止します。

(tmos)# shutdown 
The system will be shutdown momentarily

コメント

  1. imo より:

    はじめましてnw関係の仕事に携わっているimoと申します。

    Cisco関連の機材ですと情報が多いのですがロードバランサーとなると少なくなってしまうと感じております。そんな中でこういった記事は貴重です。
    感謝にたえません。

    もし御存知でしたら教えて頂きたいのですが、ハードウェアの障害か対抗先のインターフェースの障害か見分ける際には何処をみたら良いのでしょうか。

    Cisco機器ですと、show version
    から再起動履歴を見てpower on以外であればshow flashなどでcrash infoの生成があるか見れば瞭然でもしくはshow logから問題のインターフェースを確認しwan側経路の問題であれば回線調査を行い経路の問題かインターフェースの問題か選択肢を消していくのが正攻法かと考えています。

    ロードバランサー[big-ip]の場合、logコマンドでも複数ありますしどうすれば良いのか途方にくれてまして、もしご教示いただけたら幸いです。

    • 博田 登 博田 登 より:

      imoさん、コメントありがとうございます。

      ハードウェアやインターフェースの故障が原因かどうかを調べるには、以下の手順が一般的にはよろしいかと思います。

      1.デバイスのログを確認:
      tmsh show sys log コマンドを使用してシステムログを確認します。

      2.インターフェースとルーティングを調査:
      tmsh show net interface を使用してインターフェースの状態を確認します。
      tmsh show net route を使用してルーティング状態を確認します。

      3.物理的な接続をテスト:
      すべてのケーブルとコネクタがしっかり接続されているか、確認します。
      物理的な問題を排除するために、ケーブルを交換してみるのもよいかと思います。

      4.パフォーマンスを監視:
      tmsh show sys performance system を使用してパフォーマンス情報を確認します。

      5.設定情報を確認:
      tmsh list を使用して構成情報を確認します。

      上記の手順を実行してもハードウェアの故障が原因かどうか特定できない場合は、QKView(構成、診断情報)を取得し、サポートやメーカーに相談するのがよろしいかと思います。

      ご不明点がございましたら、コメントでお知らせください。

      • imo より:

        ご回答ありがとうございます。

        切り分けの際に役立つ情報を頂き感謝いたします。

        正直な所、あまりLBのログを見ることが少なくどの点が異常ログなのかという点はまだ理解出来ていないのですが、これからログを沢山見て理解につなげたいと考えてます。

        項番2,5でやることと言えば確かにシスコ系の器機でもshow running-configなどで設定を確認しshow interface系のコマンドで現在の状態と見比べるというのは確かにやっていたなと思い出しました(思い出してもLBでどういうコマンドが正しいかピンときていなかったのですが)。

        自分の中で何を攻めるべきか見えてきました。
        お時間割いていただいてありがとうございました。