「glances」の版間の差分

提供: FreeBSD入門
移動: 案内検索
(ページの作成:「glances とは、CPU、メモリ、ネットワーク、ディスクI/O、ファイルシステムの利用状況が確認できるコマンドです。サーバモ...」)
(相違点なし)

2014年8月14日 (木) 21:33時点における版

glances とは、CPU、メモリ、ネットワーク、ディスクI/O、ファイルシステムの利用状況が確認できるコマンドです。サーバモードとクライアントモードがあり、サーバモードで起動したglancesにほかのノードからクライアントモードで起動したglancesに接続し、モニタリングできます。

読み方

glances
ぐらんすず

概要

glances は、topdfiostat などをコンビネーションしたようなコマンドです。

パッケージの探し方

$ pkg search glances
py27-glances-2.0

インストール

pkgコマンドでインストールする場合

sudo pkg install glances
$ sudo pkg install py27-glances
Updating repository catalogue
Fetching meta.txz: 100% of 944 B
Fetching digests.txz: 100% of 2 MB
Fetching packagesite.txz: 100% of 5 MB
Removing expired entries: 100%
Adding new entries: 100%
Incremental update completed, 23436 packages processed:
23277 packages updated, 36 removed and 159 added.
New version of pkg detected; it needs to be installed first.
The following 1 packages will be affected (of 0 checked):
 
Installed packages to be UPGRADED:
        pkg: 1.3.5.1 -> 1.3.6
 
The process will require 312 KB more space
2 MB to be downloaded
 
Proceed with this action [y/N]: y
Fetching pkg-1.3.6.txz: 100% of 2 MB
Checking integrity... done (0 conflicting)
[1/1] Upgrading pkg from 1.3.5.1 to 1.3.6: 100%
Updating repository catalogue
FreeBSD repository is up-to-date
All repositories are up-to-date
The following 2 packages will be affected (of 0 checked):
 
New packages to be INSTALLED:
        py27-glances: 2.0
        py27-psutil: 2.1.1
 
The process will require 3 MB more space
2 MB to be downloaded
 
Proceed with this action [y/N]: y
Fetching py27-glances-2.0.txz: 100% of 2 MB
Fetching py27-psutil-2.1.1.txz: 100% of 95 KB
Checking integrity... done (0 conflicting)
[1/2] Installing py27-psutil-2.1.1: 100%
[2/2] Installing py27-glances-2.0: 100%

設定

サンプルの設定ファイルは、

/usr/local/etc/glances/glances.conf.sample

です。

使い方

コマンドラインオプション

usage: glances [-h] [-V] [-b] [-B BIND_ADDRESS] [-c CLIENT] [-C CONF_FILE]
               [--disable-bold] [--disable-diskio] [--disable-fs]
               [--disable-network] [--disable-sensors] [--disable-process]
               [--disable-log] [--output-csv OUTPUT_CSV] [-p PORT]
               [--password-badidea PASSWORD_ARG] [--password] [-s]
               [--snmp-community SNMP_COMMUNITY] [--snmp-port SNMP_PORT]
               [--snmp-version SNMP_VERSION] [--snmp-user SNMP_USER]
               [--snmp-auth SNMP_AUTH] [-t TIME] [-w] [-1]
 
optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -b, --byte            display network rate in byte per second
  -B BIND_ADDRESS, --bind BIND_ADDRESS
                        bind server to the given IPv4/IPv6 address or hostname
  -c CLIENT, --client CLIENT
                        connect to a Glances server by IPv4/IPv6 address or
                        hostname
  -C CONF_FILE, --config CONF_FILE
                        path to the configuration file
  --disable-bold        disable bold mode in the terminal
  --disable-diskio      disable disk I/O module
  --disable-fs          disable filesystem module
  --disable-network     disable network module
  --disable-sensors     disable sensors module
  --disable-process     disable process module
  --disable-log         disable log module
  --output-csv OUTPUT_CSV
                        export stats to a CSV file
  -p PORT, --port PORT  define the client/server TCP port [default: 61209]
  --password-badidea PASSWORD_ARG
                        define password from the command line
  --password            define a client/server password from the prompt or
                        file
  -s, --server          run Glances in server mode
  --snmp-community SNMP_COMMUNITY
                        SNMP community
  --snmp-port SNMP_PORT
                        SNMP port
  --snmp-version SNMP_VERSION
                        SNMP version (1, 2c or 3)
  --snmp-user SNMP_USER
                        SNMP username (only for SNMPv3)
  --snmp-auth SNMP_AUTH
                        SNMP authentication key (only for SNMPv3)
  -t TIME, --time TIME  set refresh time in seconds [default: 3 sec]
  -w, --webserver       run Glances in web server mode
  -1, --percpu          start Glances in per CPU mode

サーバ・クライアントモード

監視したいノードで、サーバモードで起動します。

10.0.0.2$ glances -s

監視もとのノードで、glancesをクライアントモードで起動します。このとき、リモートのノードのホスト名(もしくは、IPアドレス)を指定します。

192.168.0.2$ glances -c 10.0.0.2

関連項目