System Activity Grapher - インストール手順(通常)

SAGにはインストーラが付属しており、通常のインストールは、このインストーラにより行うことができます。

インストールはroot権限で行います。

ダウンロード

インストーラをダウンロードします。

sag-demo# ftp https://fuguita.org/sag/install.sh
Trying 133.242.176.115...
Requesting https://fuguita.org/sag/install.sh
100% |**************************************************|  4511	      00:00 ETA
4511 bytes received in 0.00 seconds (1.17 MB/s)
# 

起動

ダウンロードが完了したら、インストーラを実行します。

sag-demo# sh ./install.sh

最初に、SAGの動作モードを設定します。動作モードは2つあります。

cronモード
SAGの動作はcronによりスケジューリングされ、動作します。
standaloneモード
cronを使わずにSAG単体で動作します。

デフォルトは、standaloneモードです。

Select installation type:
  1:  cron
  2: [standalone]
->2

gnuplotがインストールされます。

## Installing dependencies from package
quirks-6.121(signed) 2023-06-16T09:53:28Z
quirks-6.121: ok
gnuplot-5.2.7p1:bzip2-1.0.8p0: ok
  〜略〜
gnuplot-5.2.7p1:pcre2-10.37p1: ok
gnuplot-5.2.7p1: ok
Running tags: ok

sagアカウントが作成されます。

## Creating SAG account: user=sag, group=sag, home=/home/sag

sagがダウンロードされます。

## Downloading SAG tarball
sag.tar.gz   100% |*************************************| 18574      00:00 ETA  

これ以降は、各種設定を行います。

まず最初は、設定ファイルdfplot.gpの内容が表示され、このファイルを編集するかどうか訊かれます。

==== Here is generated dfplot.gp
plot \
    "sumtmp-0100df" using 1:3 title "/", \
    "sumtmp-0100df" using 1:4 title "/sysmedia", \
    "sumtmp-0100df" using 1:5 title "/fuguita", \
    "sumtmp-0100df" using 1:6 title "/ram", \
    "sumtmp-0100df" using 1:7 title "/ram/home/kaw/sag"
#
# Edit the gnuplot configuration above to match the actual file system
# layout shown below.
#
# You can rearrange or delete the configuration lines as you wish.
#
# Filesystem     Size    Used   Avail Capacity  Mounted on
# /dev/rd0a      1.5M   1005K    547K    65%    /
# /dev/sd0a      1.1G    1.1G    8.1M   100%    /sysmedia
# /dev/vnd5a     1.1G    1.1G    4.1M   100%    /fuguita
# mfs:25873      4.3G    204M    3.9G     5%    /ram
# /dev/sd0e      439M    214K    417M     1%    /ram/home/kaw/sag
==== Edit this file? [y/N] -> 

これは、実際のパーティション情報をもとに自動生成された、gnuplotの描画指示です。

この内容のままでよければ n と応えて次に進みます。yと応えるとテキストエディタが立ち上がりますので、描画指示を修正し、エディタを終了します。

次に、ネットワークインターフェースを指定するファイルnetcmd.shを編集するかどうかを訊かれます。

==== Here is generated netcmd.sh
# a command line to get i/f name, send/receive bytes
# then print them out
#
# this command will eval-ed by $SAGHOME/bin/t0001
#
# $Id: netcmd.sh,v 1.4 2023/06/15 08:45:27 kaw Exp $

netcmd='set $(netstat -I vio0 -b -n -i); echo $7 ${11} ${12}'
#                        ~~~~\
#                             rewrite this to your actual
#                             network interface
==== Edit this file? [y/N] -> 

これも同様にy又はnで応えます。

このファイルでは、測定するネットワークインターフェースが指定されます。当初はデフォルトルートとなるデバイスが指定されています。これとは異なるネットワークインターフェースを指定したい場合は、yと応え、設定内容を変更して下さい。

次は、shconf.shの編集です。このファイルでは取得データの保持日数と各測定項目のグラフ表示期間が指定されます。

==== Here is shconf.sh
#  shconf.sh  -  shell variable configuration for SAG
#
#  $Id: shconf.sh,v 1.4 2023/07/28 02:01:07 kaw Exp $

# categories to process data
#
targets='0001la 0001procs 0005mem 0100df 0001net 0005timeofs 0100time'

# days to store data
#
rotate_max=32

# days to display graph
#
     span_la=8
  span_procs=8
    span_mem=8
     span_df=32
    span_net=8
span_timeofs=8
   span_time=32
==== Edit this file? [y/N] -> y

測定項目、測定データ保存期間、各測定項目のグラフ表示期間などを変更したい場合は、yと応えてこのファイルを編集して下さい。

続いて、各種設定が自動で行われます。

## Preparing stuffs to aggregate and plot data
## Setting up root's crontab
## Setting up the startup file
## Setting up sag's crontab
## Setting up web-related stuffs

最後に、グラフ生成後の処理を記述するファイルpostgproc.shを編集するかどうか訊かれます。

==== Here is postgproc.sh, a script to copy graphs to Web. if not needed, leave this untouched.
#!/bin/sh

# processes after generating graphs
# This script will be called by $SAGHOME/bin/t0100
#
# $Id: postgproc.sh,v 1.3 2021/10/04 15:26:38 kaw Exp $

# To enable this,

# Make next line commented.
exit 0

# and follwing lines uncommented
#
# # sample of post process
# sleep 60
# cp $SAGHOME/var/*.png /var/www/htdocs/sag/.
==== Edit this file? [y/N] -> y

yでエディタを立ち上げ、"exit 0"の行をコメントアウトし、"# sleep 60"とその後の行を非コメント化することで、毎時生成されたグラフは、ディレクトリ/var/www/htdocs/sagにコピーされるようになります。

以上でインストール作業は終りです。

standaloneモードを選択した場合は、今からSAGを起動するかどうか訊かれます。Nと答えた場合は、次回のOS起動後からSAGが動作します。

==== Edit this file? [y/N] -> y
==== You need to add the entry on your httpd.conf(8) file.
====
==== start SAG now? [y/N] -> y
sag_ticker.sh is running, PID is 16476

cronモードの場合は、SAGはすでに動作しています。

## All done.
##
## You need to add the entry on your httpd.conf(8) file.
##
sag-demo# 

グラフをウェブで閲覧する場合はhttpd.confの編集など、関連する設定も行って下さい。



Front page   New Page list Search Recent changes   Help   RSS of recent changes