[root]# mbmon -rc1 TEMP0 : 34.0 TEMP1 : 39.0 TEMP2 : 0.0 FAN0 : 2070 FAN1 : 0 FAN2 : 0 VC0 : +1.20 VC1 : +0.05 V33 : +3.47 V50P : +4.92 V12P : +11.80 V12N : +2.94 V50N : +0.38 |
[root]# cd /usr/local/HotSaNIC [root}# rm -r -f * .* |
[root]# cd /usr/local [root]# tar xvf hotsanic-0.5.0-pre5.tgz HotSaNIC/ HotSaNIC/CVS/ HotSaNIC/CVS/Root HotSaNIC/CVS/Repository HotSaNIC/CVS/Entries HotSaNIC/CVS/Tag 途中省略 HotSaNIC/Documentation/ HotSaNIC/Documentation/CVS/ HotSaNIC/var/CVS/Entries HotSaNIC/var/CVS/Tag HotSaNIC/var/.cvsignore [root]# |
VARDIR="/var/log/HotSaNIC/" LOGDIR="/var/log/HotSaNIC/" PIDFILE="/var/run/rrdtimer.pid" |
WEBDIR="/home/localhost/HotSaNIC" |
IMAGEFORMAT="png" |
[root]# makeindex.pl generating index-files for each plugin... diskio moving index-files to webdir networks moving index-files to webdir sensors moving index-files to webdir system moving index-files to webdir traffic moving index-files to webdir building /home/localhost/HotSaNIC/index.html ... table-size: 2 lines. Modules are added in this order: traffic system sensors diskio networks done. |
[root]# rrdgraph start Starting rrdtimer... reading & checking config (/usr/local/HotSaNIC/settings) ... evaluating cmdline arguments... entering daemon mode... |
[root]# ps ax 29400 pts/0 S 0:00 rrdtimer 29442 pts/0 S 0:00 perl ./read-data.pl start diskio 29445 pts/0 S 0:00 perl ./read-data.pl start networks 29448 pts/0 S 0:00 perl ./read-data.pl start sensors 29452 pts/0 S 0:00 perl ./read-data.pl start system 29456 pts/0 S 0:00 perl ./read-data.pl start traffic |
[root]# convert.pl Using Image::Magick perl-module resizing /home/localhost/HotSaNIC/traffic/ppp0-week.png resizing /home/localhost/HotSaNIC/system/load-week.png resizing /home/localhost/HotSaNIC/system/proc-week.png resizing /home/localhost/HotSaNIC/system/cpu-week.png resizing /home/localhost/HotSaNIC/system/mem-week.png resizing /home/localhost/HotSaNIC/system/swap-week.png resizing /home/localhost/HotSaNIC/system/users-week.png resizing /home/localhost/HotSaNIC/system/irq-week.png resizing /home/localhost/HotSaNIC/system/uptime-week.png resizing /home/localhost/HotSaNIC/diskio/hda-week.png |
[root]# cd modules/traffic [root]# vi settings |
SWAPIO="yes" |
STYLE="bits" |
DEV="ppp0,12500000,12500000,B-Flets fibre network 100M" |
[root]# rrdgraph stop |
[root]# clearall CLEAR_WEBPAGE This will destroy everything under /home/localhost/HotSaNIC and therefore your web-graphs. Enter yes to continue yes [root]# clearall CLEAR_DATABASES This will destroy all sampled data. Enter yes to continue yes [root]# clearall CLEAR_GRAPHS |
[root]# makeindex.pl ; rrdgraph start ; convert.pl |
LC_TIME="abday" export LC_TIME PERL_BADLANG=0 export PERL_BADLANG |
STYLE="bits" |
DEVEXT="ppp0,B-Flets fibre 100M" |
rrdtool create rrd/CPU-TEMP.rrd \ >--step 300 \ >DS:CPU:GAUGE:600:U:U \ >RRA:LAST:0.5:1:288000 |
それぞれの行の説明をすると、 |
rrdtool create rrd/CASE-TEMP.rrd \ >--step 300 \ >DS:CASE:GAUGE:600:U:U \ >RRA:LAST:0.5:1:288000 |
[root]# ls -ltr 合計 3296 -rw-r--r-- 1 root root 1682460 Aug 1 17:28 CPU-TEMP.rrd -rw-r--r-- 1 root root 1682460 Aug 1 17:28 CASE-TEMP.rrd |
[root]# rrdtool info CPU-TEMP.rrd filename = "CPU-TEMP.rrd" rrd_version = "0001" step = 300 last_update = 1091348880 ds[CPU].type = "GAUGE" ds[CPU].minimal_heartbeat = 300 ds[CPU].min = -5.0000000000e+01 ds[CPU].max = 1.0000000000e+02 ds[CPU].last_ds = "UNKN" ds[CPU].value = 7.4700000000e+03 ds[CPU].unknown_sec = 0 rra[0].cf = "LAST" rra[0].rows = 210240 rra[0].pdp_per_row = 1 rra[0].xff = 5.0000000000e-01 rra[0].cdp_prep[0].value = NaN rra[0].cdp_prep[0].unknown_datapoints = 0 |
[root]# mbmon -c 1 Temp.= 37.0, 41.5, 0.0; Rot.= 2070, 0, 0 Vcore = 1.22, 0.05; Volt. = 3.47, 4.92, 11.80, 2.94, 0.38 |
[root]# mbmon -T1 -c 1 37.0 |
[root]# perl -e 'print time' 1091349632[root]# |
current_time=`perl -e 'print time'` |
#!/bin/bash # #環境変数セット # rrddir="/usr/local/HotSaNIC/modules/sensors/rrd" rrdbin="/usr/local/rrdtool/bin/rrdtool" mbmbin="/usr/local/bin/mbmon" #各種 data取得 # current_time=`perl -e 'print time'` case_temp=`/usr/local/bin/mbmon -T1 -c 1` cpu_temp=`$mbmbin -T2 -c 1` #rrdファイル更新 # $rrdbin update $rrddir/CASE-TEMP.rrd $current_time:$case_temp $rrdbin update $rrddir/CPU-TEMP.rrd $current_time:$cpu_temp |
*/4 * * * * /usr/local/HotSaNIC/modules/sensors/sensor-temp-update.sh |
#!/bin/bash # rrddir="/usr/local/HotSaNIC/modules/sensors/rrd" rrdbin="/usr/local/rrdtool/bin/rrdtool" mbmbin="/usr/local/bin/mbmon" websensor="/home/localhost/HotSaNIC/sensors" #graph出力 # $rrdbin graph $websensor/mbmon-cpu-hour.png \ --imgformat PNG \ -s -3600 \ DEF:CPU=$rrddir/CPU-TEMP.rrd:CPU:LAST \ AREA:CPU#00CF00:"CPU temp C" |