#author("2023-06-21T03:25:03+09:00","default:kaw","kaw")
#author("2023-06-21T03:26:54+09:00","default:kaw","kaw")
#navi(SAG)
*System Activity Grapher - インストール手順(通常) [#vd07133c]
SAGにはインストーラが付属しており、通常のインストールは、このインストーラにより行うことができます。

インストールはroot権限で行います。
**ダウンロード [#u82a52c7]
インストーラをダウンロードします。
 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)
 # 
**起動 [#hdf06f80]
ダウンロードが完了したら、インストーラを実行します。
 sag-demo# sh ./install.sh
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    
 sag.tar.gz   100% |*************************************| 18574      00:00 ETA  
ディスクパーティションのプロットを指定するファイルdfplot.gpを編集するためにテキストエディタが起動されます。
 ## Edit dfplot.gp - specify disk partitions to plot, if necessary.
編集内容はgnuplotの設定ファイルで、内容は以下のとおりです。これは、実際のパーティション情報をもとに自動生成されているので、このままでよければエディタをそのまま終了して下さい。
 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"
 #
 # 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    1.0M    476K    69%    /
 # /dev/cd0a     1023M   1023M      0B   100%    /sysmedia
 # /dev/vnd5a     996M    995M    1.4M   100%    /fuguita
 # mfs:12614      1.4G    296M    1.1G    22%    /ram
ネットワークインターフェースを指定するファイルnetcmd.shを編集するためにテキストエディタが起動されます。
 ## Edit netcmd.sh - specify the network interface to plot.
下のように、実際に測定したいネットワークインターフェース名を指定して下さい。当初はデフォルトルートとなるデバイスが指定されています。そのようなデバイスがない場合は、適当なイーサネット、あるいはWiFiデバイスが指定されています。
 # 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
取得データの保持日数と各測定項目のグラフ表示期間を指定するファイルnetcmd.shを編集するためにテキストエディタが起動されます。
 ## Edit shconf.sh - specify spans to archive logs and plot graphs.
デフォルトでよければ編集を行わずにエディタを終了して下さい。
 #  shconf.sh  -  shell variable configuration for SAG
 #
 #  $Id: shconf.sh,v 1.3 2021/10/04 15:22:35 kaw Exp $
 
 # categories to process data
 #
 targets='0001la 0001net 0005mem 0100df 0100time 0005timeofs'
 
 # days to store data
 #
 rotate_max=64
 
 # days to display graph
 #
      span_la=8
     span_net=8
     span_mem=8
      span_df=32
    span_time=32
 span_timeofs=8
続いて、各種設定が自動で行われます。
 ## 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
グラフの画像ファイルをウェブのドキュメントルート配下にコピーするためのファイルgpostproc.shを編集するためにテキストエディタが起動されます。
 ## Edit 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/.
以上で終りです。~
グラフをウェブで閲覧する場合はhttpd.confの編集など、関連する設定を行って下さい。
 ## All done.
 ##
 ## You need to add the entry on your httpd.conf(8) file.
 ##
 sag-demo# 
///
/// sag-demo# crontab -l
/// #
/// SHELL=/bin/sh
/// PATH=/bin:/sbin:/usr/bin:/usr/sbin
/// HOME=/var/log
///   〜略〜
/// #
/// # ### for System Activity Grapher logging system ###
/// #
/// # $Id: crontab-root,v 1.2 2017/01/07 06:10:54 kaw Exp $
/// #
/// # Add a following line to crontab of root.
/// #
/// 4-59/5	*	*	*	*	ntpctl -s all > /tmp/ntpctl.out
/// 
/// sag-demo# crontab -u sag -l
/// # ### for System Activity Grapher logging system ###
/// #
/// # $Id: crontab,v 1.2 2017/01/07 06:10:54 kaw Exp $
/// #
/// #
/// SHELL=/bin/sh
/// PATH=/bin:/sbin:/usr/bin:/usr/sbin
/// #
/// # Important - base directory of SAG
/// # Reconfigure if needed.
/// #
/// SAGHOME=/home/sag
/// #
/// #minute hour	mday	month	wday	command
/// #
/// *	*	*	*	*	exec $SAGHOME/bin/tick
/// */5	*	*	*	*	chmod u+x $SAGHOME/bin/t0005
/// 50	*	*	*	*	chmod u+x $SAGHOME/bin/t0100
/// 10	4	*	*	*	chmod u+x $SAGHOME/bin/t2400
/// 
/// sag-demo# cat /etc/rc.local
/// # for System Activity Grapher
/// # Add this to /etc/rc.local
/// #
/// # $Id: rc.local,v 1.2 2017/01/07 06:10:54 kaw Exp $
/// 
/// su -l sag -c '/home/sag/bin/addgap' # Rewrite to the real location.
/// 
/// # setups for ntp monitoring
/// #
/// touch /tmp/ntpctl.out
/// chown sag:sag /tmp/ntpctl.out
/// chmod 0640 /tmp/ntpctl.out
/// 
/// sag-demo# ls -l /home/
/// total 2
/// drwxr-xr-x  8 sag  sag	512 Jun 18 22:08 sag
/// 
/// sag-demo# su - sag
/// fugu-demo$ ls -l
/// total 94
/// -rw-r--r--  1 sag  sag	17655 Jun 18 22:07 INSTALL-EN.md
/// -rw-r--r--  1 sag  sag	12904 Jun 18 22:07 INSTALL-JA.md
/// -rw-r--r--  1 sag  sag	 3514 Jun 18 22:07 README.en
/// -rw-r--r--  1 sag  sag	 2922 Jun 18 22:07 README.eucjp
/// drwxr-xr-x  2 sag  sag	  512 Jun 18 22:07 bin
/// drwxr-xr-x  3 sag  sag	  512 Jun 18 22:08 conf
/// -rw-r--r--  1 sag  sag	 4511 Jun 18 22:07 install.sh
/// drwxr-xr-x  3 sag  sag	  512 Jun 18 22:08 plot
/// drwxr-xr-x  2 sag  sag	  512 Jun 18 22:09 var
/// 
/// fugu-demo$ ls -l var
/// total 2
/// -rw-r--r--  1 sag  sag	73 Jun 18 22:09 rl0001
/// 
/// fugu-demo$ cat var/rl0001
/// =dt 2023 06 18 22 09
/// =la 0.19 0.24 0.12
/// =net
/// vio0 116075509 3481575
/// =end
/// =dt 2023 06 18 22 10
/// =la 0.14 0.21 0.11
/// =net
/// vio0 116076409 3482475
/// =end
/// 
/// fugu-demo$ df -h
/// Filesystem     Size    Used   Avail Capacity  Mounted on
/// /dev/rd0a      1.5M    1.0M    476K    69%    /
/// /dev/cd0a     1023M   1023M	 0B   100%    /sysmedia
/// /dev/vnd5a     996M    995M    1.4M   100%    /fuguita
/// mfs:12428      2.9G    296M    2.5G    11%    /ram
/// 
/// fugu-demo$ exit
/// sag-demo# pkg_delete git
/// git-2.40.0: ok
/// Read shared items: ok
/// You should also run /usr/sbin/userdel _gitdaemon
/// You should also run /usr/sbin/groupdel _gitdaemon
/// sag-demo# pkg_delete -a
/// nghttp3-0.9.0: url-8.1.2: ok
///   〜略〜
///     :
///     :
/// p5-Time-TimeDate-2.33: ok
/// Read shared items: ok
/// sag-demo# df -h
/// Filesystem     Size    Used   Avail Capacity  Mounted on
/// /dev/rd0a      1.5M    1.0M    476K    69%    /
/// /dev/cd0a     1023M   1023M	 0B   100%    /sysmedia
/// /dev/vnd5a     996M    995M    1.4M   100%    /fuguita
/// mfs:12428      2.9G    217M    2.5G	8%    /ram
/// 
/// sag-demo# ls /var/db/pkg
/// bzip2-1.0.8p0		   jpeg-2.1.4v0		      python-3.10.11
/// cairo-1.17.8		   libcerf-1.13p0	      quirks-6.121
/// fribidi-1.0.12		   libffi-3.4.4		      readline-7.0p0
/// gd-2.3.3		   libiconv-1.17	      rlwrap-0.45.2
/// gettext-runtime-0.21.1	   libwebp-1.2.4	      rsync-3.2.7
/// giflib-5.2.1		   lz4-1.9.4		      sqlite3-3.41.0
/// glib2-2.74.6		   lzo2-2.10p2		      tiff-4.5.0p0
/// gnuplot-5.2.7p1		   pango-1.50.14	      xz-5.4.1
/// graphite2-1.3.14	   pcre2-10.37p1	      zstd-1.5.5
/// harfbuzz-7.1.0		   png-1.6.39
/// intel-firmware-20230214v0  pv-1.6.20

#navi(SAG)

Front page   Edit Diff History Attach Copy Rename Reload   New Page list Search Recent changes   Help   RSS of recent changes