17 posts categorized "MRTG"

Nov 09, 2005

MRTG (10) M/B,CPU temperature

lm_senserが動作するようになったので、MRTGにてモニタをしたいと
思います。

# vi /usr/local/mrtg-2/data/local_mrtg.cfg
----
####################
### M/B & CPU temp
Target[cputemp]: `/usr/local/bin/sensors | grep Temp | awk '{print $3}' | sed -e 's/+//' -e 's/[^0-9+\.].*//'`
MaxBytes[cputemp]: 100
Title[cputemp]: M/B & CPU Temperature
PageTop[cputemp]: M/B & CPU Temperature
Options[cputemp]: growright,absolute,gauge,nopercent,noinfo
WithPeak[cputemp]: ymw
#unscaled[cputemp]: dwmy
YLegend[cputemp]: Temperature
ShortLegend[cputemp]: C
LegendI[cputemp]: M/B
LegendO[cputemp]: CPU
Legend1[cputemp]: M/B
Legend2[cputemp]: CPU

--inde.htmlの作成
# /usr/local/mrtg-2/bin/indexmaker /usr/local/mrtg-2/data/local_mrtg.cfg > /home/httpd/html/mrtg/local/index.html

| | Comments (0) | TrackBack (0)

Oct 01, 2005

MRTG(9) DNSクエリー

MRTG(9) DNSクエリー数

rndcコマンドを使った統計情報の出力をMRTGでグラフ化する。

rndcとは
# /usr/sbin/rndc status
number of zones: 4
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
server is up and running

***上記のような統計情報が出力される***

この情報を一見しただけではいまいち理解しがたいのでMRTGで
グラフ化します。
dnsstats.pl このスクリプトを使用します。

--dnsstatsのダウンロード
http://prdownloads.sourceforge.net/statusreport/dnsstats.pl?download

--dnsstatsの設定
# cp dnsstas.pl /usr/local/mrtg-2/bin/dnsstats.pl
# chmod 755 dnsstats.pl
# vi dnsstats.pl

----
# Set location of "rndc". Change to "ndc" for versions < 9
my $rndc = "/usr/sbin/rndc";

my $newstatfile = "/var/named/named.stats";
-----
上記2行を環境に合わせ変更する。

--MRTG configfiele作成
# vi /usr/local/mrtg-2/data/local_mrtg.cfg
----
####################
### DNS query count
Title[dns-server]: DNS Server monitor
PageTop[dns-server]: DNS Server monitor
Target[dns-server]: `/usr/local/mrtg-2/bin/dnsstats.pl`
Options[dns-server]: growright,noinfo,nopercent,unknaszero,perminute
RouterUptime[dns-server]: hoge@localhost
MaxBytes[dns-server]: 32000
AbsMax[dns-server]: 64000
RRDRowCount[dns-server]: 3200
Colours[dns-server]: YELLOW #F9C000,RED #F90000,LIGHT YELLOW #FFFFBB, \
LIGHT RED #FF8080
ShortLegend[dns-server]:queries/m
YLegend[dns-server]: Qs per Minute
Legend1[dns-server]: Queries received over 1 minute
Legend2[dns-server]: Failed Queries received over 1 minute
Legend3[dns-server]: Maximal Queries over 5 minutes
Legend4[dns-server]: Maximal Failed Queries over 5 minutes
LegendI[dns-server]:  Queries: 
LegendO[dns-server]:  Failures: 


--参考ページ
http://www.atmarkit.co.jp/flinux/rensai/bind910/bind910b.html

| | Comments (0) | TrackBack (0)

Sep 04, 2005

MRTG (8) HDDの 温度変化

MRTGを使ってhddtemp(HDDの温度変化を表示)をグラフ化する。

--MRTGのコンフィグファイルに追加する
# vi /usr/local/mrtg-2/data/local_mrtg.cfg
-----
####################
### Disk Temperature
Target[hddtemp]: `/usr/local/sbin/hddtemp /dev/hda | awk '{print $3}'`
MaxBytes[hddtemp]: 100
Title[hddtemp]: HDD Temperature
PageTop[hddtemp]: HDD Temperature
Options[hddtemp]: growright,absolute,gauge,nopercent,noinfo
WithPeak[hddtemp]: ymw
YLegend[hddtemp]: Temperature
ShortLegend[hddtemp]: C
LegendI[hddtemp]: Temp:
LegendO[hddtemp]:
Legend1[hddtemp]: HDD Temperature in Degrees Celcius
Legend2[hddtemp]:
-----
注意:hddtempのpathを確認するように

--index.htmlファイルを作成する
#/usr/local/mrtg-2/bin/indexmaker /usr/local/mrtg-2/data/local_mrtg.cfg >
/home/httpd/html/mrtg/local/index.html


--参考ページ
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/782hddtmpmrtg.html

| | Comments (0) | TrackBack (0)

Aug 22, 2005

MRTG additional config for VAIO(2)

昨日の続き

--MRTG cfg file 作成
# /usr/local/mrtg-2/bin/cfgmaker nofx2@192.168.*.* > /usr/local/mrtg-2/data/s93s.cfg

--MRTG用のindex fileの作成
# /usr/local/mrtg-2/bin/indexmaker /usr/local/mrtg-2/data/s93s.cfg > /home/httpd/html/mrtg/s93s/index.html

--crontabへの追記
# vi /etc/crontab
-----
*/5 * * * * root /usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/data/s93s.cfg
------

| | Comments (0) | TrackBack (0)

Aug 21, 2005

MRTG additional config for VAIO

新規にLap top PC VAIO S93Sを購入したのでMRTGの監視に
追加したいと思います。

--config file
# vi /usr/local/mrtg-2/data/s93s.cfg
-----
# Created by
# ./cfgmaker nofx2@192.168.*.*

Htmldir: /home/httpd/html/mrtg/s93s

Imagedir: /home/httpd/html/mrtg/s93s/images

IconDir: icons

Logdir: /usr/local/mrtg-2/logs

Refresh: 300

Language: eucjp

EnableIPv6: no


### Interface 3 >> Descr: 'Intel(R)-PRO/Wireless-2200BG ###

Target[192.168.*.*_3]: 3:nofx2@192.168.*.*:
SetEnv[192.168.*.*_3]: MRTG_INT_IP="192.168.*.*" MRTG_INT_DESCR="Intel(R)-PRO/Wireless-2200BG-Network-Connection---パケット-スケジューラ-ミニポート"
MaxBytes[192.168.*.*_3]: 6750000
Title[192.168.*.*_3]: Traffic Analysis for 3 -- S93S
PageTop[192.168.*.*_3]: Traffic Analysis for 3 -- S93S
Options[192.168.*.*_3]: growright, noinfo


#############
### CPU Load Average

Target[cpu_s93s]:1.3.6.1.4.1.311.1.1.3.1.1.2.1.5.1.48&1.3.6.1.4.1.311.1.1.3.1.1.2.1.4.1.48:nofx2@192.168.*.*:
MaxBytes[cpu_s93s]: 100
Unscaled[cpu_s93s]: dwmy
Options[cpu_s93s]: growright, gauge, absolute, noinfo, nopercent
YLegend[cpu_s93s]: CPU Load (%)
ShortLegend[cpu_s93s]: %
Legend1[cpu_s93s]: Privileged (system) CPU use in percent
Legend2[cpu_s93s]: User (application) CPU use in percent
LegendI[cpu_s93s]: PrivCPU: 
LegendO[cpu_s93s]: UserCPU: 
Title[cpu_s93s]: CPU Load Average (Privileged & User)
PageTop[cpu_s93s]: CPU Load Average (Privileged & User)

#############
### Memory Free

Target[mem_s93s]: 1.3.6.1.4.1.311.1.1.3.1.1.1.2.0&1.3.6.1.4.1.311.1.1.3.1.1.1.3.0:nofx2@192.168.*.*:
MaxBytes1[mem_s93s]: 513540000
MaxBytes2[mem_s93s]: 756168000
Unscaled[mem_s93s]: dwmy
Options[mem_s93s]: growright, gauge, absolute, noinfo
YLegend[mem_s93s]: Bytes
ShortLegend[mem_s93s]: Bytes
Legend1[mem_s93s]: Available Memory (Bytes)
Legend2[mem_s93s]: Committed Memory (Bytes)
LegendI[mem_s93s]: Avail: 
LegendO[mem_s93s]: Commit: 
Title[mem_s93s]: Memory: Available vs Committed Byes
PageTop[mem_s93s]: Memory: Free Bytes vs. Committed Bytes


#############
### DISK Free on C:

Target[hddc_s93s]: 1.3.6.1.4.1.311.1.1.3.1.1.5.1.4.2.67.58&1.3.6.1.4.1.311.1.1.3.1.1.5.1.4.2.67.58:nofx2@192.168.*.*
MaxBytes[hddc_s93s]: 13733
kMG[hddc_s93s]: M,G
Unscaled[hddc_s93s]: dwmy
Options[hddc_s93s]: growright, gauge, absolute, noinfo, nopercent
YLegend[hddc_s93s]: Bytes
ShortLegend[hddc_s93s] : Bytes
Legend1[hddc_s93s]: Disk Space Available in Bytes
Legend2[hddc_s93s]:
LegendI[hddc_s93s]: Free: 
LegendO[hddc_s93s]:
Title[hddc_s93s]: DISK Free on C:
PageTop[hddc_s93s]: DISK Free on C


#############
### DISK Free on D:

Target[hddd_s93s]: 1.3.6.1.4.1.311.1.1.3.1.1.5.1.4.2.68.58&1.3.6.1.4.1.311.1.1.3.1.1.5.1.4.2.68.58:nofx2@192.168.*.*
MaxBytes[hddd_s93s]: 18265
kMG[hddd_s93s]: M,G
Unscaled[hddd_s93s]: dwmy
Options[hddd_s93s]: growright, gauge, absolute, noinfo, nopercent
YLegend[hddd_s93s]: Bytes
ShortLegend[hddd_s93s] : Bytes
Legend1[hddd_s93s]: Disk Space Available in Bytes
Legend2[hddd_s93s]:
LegendI[hddd_s93s]: Free: 
LegendO[hddd_s93s]:
Title[hddd_s93s]: DISK Free on D:
PageTop[hddd_s93s]: DISK Free on D

| | Comments (0) | TrackBack (0)

Apr 23, 2005

MIBブラウザ

LinuxにおいてMIB情報を見るためにはsnmpwalkコマンドを使用すればいいですが、下記参照
--SNMP による ネットワーク監視
http://www.iin.gr.jp/~taka/server/ucd-snmpd.html
Windowsにおいてはそうはいきません。
そこで"GetIf"このソフトを使うと、MIB内OIDの検索ができます。

GetIfのダウンロードは
--SNMP Informat
http://www.snmp-informant.com/
より、[Free SNMP Tools!]をたどれば見つけられるはずです。

Windowsの拡張MIBを見るためにはちょっとした設定が必要です。
ぱそこんおやじさんのページを御参考下さい。

--参考ページ
ぱそこんおやじさんのページ
http://www.aconus.com/~oyaji/mrtg/mib_win.htm

| | Comments (0) | TrackBack (0)

MRTG cfg for Windows (4)

WindowsPCでドライブの残量を見るためのconfigは。

-----
#############
### DISK Free on C:

Target[hddc]: 1.3.6.1.4.1.311.1.1.3.1.1.5.1.4.2.67.58&1.3.6.1.4.1.311.1.1.3.1.1.5.1.4.2.67.58:Home@192.168.0.3:
MaxBytes[hddc]: 21433
kMG[hddc]: M,G
Unscaled[hddc]: dwmy
Options[hddc]: growright, gauge, absolute, noinfo, nopercent
YLegend[hddc]: Bytes
ShortLegend[hddc] : Bytes
Legend1[hddc]: Disk Space Available in Bytes
Legend2[hddc]:
LegendI[hddc]: Free: 
LegendO[hddc]:
Title[hddc]: DISK Free on C:
PageTop[hddc]: DISK Free on C


--なお各ドライブは下記の通りのOIDとなる
Cドライブ 1.3.6.1.4.1.311.1.1.3.1.1.5.1.4.2.67.58
Dドライブ 1.3.6.1.4.1.311.1.1.3.1.1.5.1.4.2.67.59
Eドライブ 1.3.6.1.4.1.311.1.1.3.1.1.5.1.4.2.67.60

--Windows2000の場合、Diskのパフォーマンスカウンタが動作していないことが
あり、下記の作業を行う必要があります。
1. コマンドプロンプトを開き、「diskperf -y」
2. この状態で、MRTGの動作確認を行う。正常に動作しない場合は、下記を行う。
3. コマンドプロンプトを開き、「diskperf -n」一度カウンタをリセットし、
コマンドプロンプトを閉じてシステムを再起動する。
4. コマンドプロンプトを開き、「diskperf -y」再びMERTの動作確認をする。


--参考ページ
ぱそこんおやじさんのページ
http://www.aconus.com/~oyaji/mrtg/mrtg_win_xp.htm
いつもいつも参考にさせていただいております。

| | Comments (0) | TrackBack (0)

Apr 22, 2005

MRTG cfg for Windows (3)

WindowsPCのメモリの使用率を調べるためのConfigは

-----
#############
### Memory Free

Target[mem_v770]: 1.3.6.1.4.1.311.1.1.3.1.1.1.2.0&1.3.6.1.4.1.311.1.1.3.1.1.1.3.0:Home@192.168.0.3:
MaxBytes1[mem_v770]: 1048032000
MaxBytes2[mem_v770]: 1048032000
Unscaled[mem_v770]: dwmy
Options[mem_v770]: growright, gauge, absolute, noinfo
YLegend[mem_v770]: Bytes
ShortLegend[mem_v770]: Bytes
Legend1[mem_v770]: Available Memory (Bytes)
Legend2[mem_v770]: Committed Memory (Bytes)
LegendI[mem_v770]: Avail: 
LegendO[mem_v770]: Commit: 
Title[mem_v770]: Memory: Available vs Committed Byes
PageTop[mem_v770]: Memory: Free Bytes vs. Committed Bytes


SNMP Informantのインストールをお忘れなく

--参考ページ
SNMPによるネットワークモニタリング
http://www.itmedia.co.jp/help/howto/linux/0007master/06/

| | Comments (0) | TrackBack (0)

Apr 21, 2005

MRTG cfg for Windows (2)

Windows PCのCPU使用率を調べるためのConfigです。

まずMIBの拡張をするために ”SNMP Informant ”をインストールします。
下記URLより左の”Download”をクリックしファイルをダウンロードします。
--SNMP Informant
http://www.snmp-informant.com/
インストールはZipファイルを解凍後、Yes, Yesでインストールできます。

--config file
-----
#############
### CPU Load Average

Target[cpu_v770]:1.3.6.1.4.1.311.1.1.3.1.1.2.1.5.1.48&1.3.6.1.4.1.311.1.1.3.1.1.2.1.4.1.48:Home@192.168.0.3:
MaxBytes[cpu_v770]: 100
Unscaled[cpu_v770]: dwmy
Options[cpu_v770]: growright, gauge, absolute, noinfo, nopercent
YLegend[cpu_v770]: CPU Load (%)
ShortLegend[cpu_v770]: %
Legend1[cpu_v770]: Privileged (system) CPU use in percent
Legend2[cpu_v770]: User (application) CPU use in percent
LegendI[cpu_v770]: PrivCPU: 
LegendO[cpu_v770]: UserCPU: 
Title[cpu_v770]: CPU Load Average (Privileged & User)
PageTop[cpu_v770]: CPU Load Average (Privileged & User)


--参考ページ
ぱそこんおやじさんのページ
http://www.aconus.com/~oyaji/mrtg/mrtg_win_xp.htm

SNMPによるネットワークモニタリング
http://www.itmedia.co.jp/help/howto/linux/0007master/06/

| | Comments (0) | TrackBack (0)

Apr 20, 2005

MRTG cfg for Windows (1)

Windows用 MRTG NICトラフィック用 config

-----
Target[192.168.0.3_2]: 2:Home@192.168.0.3:
SetEnv[192.168.0.3_2]: MRTG_INT_IP="192.168.0.3" Options[192.168.10.3_2]: growright, noinfo
MaxBytes[192.168.0.3_2]: 12500000
Title[192.168.0.3_2]: Traffic Analysis for Windows
PageTop[192.168.0.3_2]: Traffic Analysis for Windows

| | Comments (0) | TrackBack (0)

Mar 08, 2005

MRTG (7)

MRTGにてHDDの監視 /の監視は

/etc/snmpd/snmpd.confの編集が必要

disk /
disk /home

と追記すると
/ が.1.3.6.1.4.1.2021.9.1.9.1
/home が、.1.3.6.1.4.1.2021.9.1.9.2

# vi /usr/local/mrtg-2/data/local_mrtg.cfg

--------------------------
#################
### Disk Used
Target[disk1]: .1.3.6.1.4.1.2021.9.1.9.1&.1.3.6.1.4.1.2021.9.1.9.1:hoge@localhost
MaxBytes[disk1]: 100
Unscaled[disk1]: dwmy
Options[disk1]: gauge, absolute, growright, nopercent, noinfo
YLegend[disk1]: Disk Used(%)
ShortLegend[disk1]: (%)
LegendI[disk1]: / Disk used
LegendO[disk1]: / Disk Used
Legend1[disk1]: / Disk used
Legend2[disk1]: / Disk used
Title[disk1]: Disk Used /
PageTop[disk1]: Disk Used /
--------------------------

MRTG用のindex fileを作成するために下記のコマンドを実行

# /usr/local/mrtg-2/bin/indexmaker /usr/local/mrtg-2/data/local_mrtg.cfg > /home/httpd/html/mrtg/local/index.html

| | Comments (0) | TrackBack (0)

Mar 07, 2005

MRTG (6)

--メモリ監視
グラフ1に空き実メモリ、グラフ2には空きSWAPメモリをとっています。

# vi /usr/local/mrtg-2/data/local_mrtg.cfg

---------------------------
####################
### Memory Free

Target[mem]: .1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.4.0:hoge@localhost
MaxBytes1[mem]: 234000
MaxBytes2[mem]: 255560
Unscaled[mem]: dwmy
Options[mem]: gauge, absolute, growright, noinfo
YLegend[mem]: Mem Free(Bytes)
ShortLegend[mem]: Bytes
kilo[mem]: 1024
kMG[mem]: k,M,G,T,P
LegendI[mem]: Real
LegendO[mem]: Swap
Legend1[mem]: free Real Memorys[MBytes]
Legend2[mem]: free SWAP Memorys[MBytes]
Title[mem]: Memory Free
PageTop[mem]: Memory Free
---------------------------

| | Comments (0) | TrackBack (0)

Mar 06, 2005

MRTG (5)

MRTGにてCPUの使用率監視を追加

--MRTG config file
/usr/local/mrtg-2/data/local_mrtg.cfg

--------------------------------
####################
### Rate of CPU

Target[cpu]: .1.3.6.1.4.1.2021.11.9.0&.1.3.6.1.4.1.2021.11.10.0:hoge@localhost
MaxBytes[cpu]: 100
Unscaled[cpu]: dwmy
Options[cpu]: gauge, absolute, growright, noinfo, nopercent
YLegend[cpu]: CPU usage(%)
ShortLegend[cpu]: (%)
LegendI[cpu]: ユーザ  
LegendO[cpu]: システム
Legend1[cpu]: CPU使用率(ユーザ)(%)
Legend2[cpu]: CPU使用率(システム)(%)
Title[cpu]: Rate of CPU use
PageTop[cpu]: Rate of CPU use
--------------------------------

毎回参考にさせていただいております。
パソコンおやじさんのページ
http://www.aconus.com/~oyaji/

| | Comments (0) | TrackBack (0)

Mar 05, 2005

MRTG (4)

ようやく起動までこぎつけました。前回のエラーはsnmpd.confのスペルミスでした。

--MRTG config file

/usr/local/mrtg-2/data/local_mrtg.cfg

-------------------------
# htmlファイルを置くディレクトリ指定
Htmldir: /home/httpd/html/mrtg/local

# グラフ(pngファイル)を置くディレクトリをImagedirで指定
Imagedir: /home/httpd/html/mrtg/local/images

# mrtgのロゴを置くディレクトリをIconDir指定
IconDir: icons

# mrtgのログを置くディレクトリをLogdirで指定
Logdir: /usr/local/mrtg-2/logs

# ブラウザのリフレッシュ間隔(5分:ブラウザで表示したままにしておくと指定間隔でリフレッシュされる)
Refresh: 300

# デフォルトではヨーロッパ言語になり文字化けするので日本語表示を指定
Language: eucjp

#####################
### Traffic_Analysis

Target[Traffic_Analysis]: 2:hoge@localhost:
SetEnv[Traffic_Analysis]: MRTG_INT_IP="192.168.0.10" MRTG_INT_DESCR="eth0"
MaxBytes[Traffic_Analysis]: 1250000
YLegend[Traffic_Analysis]: Traffic
Options[Traffic_Analysis]: growright, noinfo
Title[Traffic_Analysis]: Traffic Analysis
PageTop[Traffic_Analysis]: Traffic Analysis
-------------------------

5分起きに実行するためcronに登録
# vi /etc/crontab
------
*/5 * * * * root /usr/local/mrtg-2/bin/mrtg /usr/local/mrtg-2/data/local_mrtg.cfg
------

# service crond restart
crondサービスの再起動

| | Comments (0) | TrackBack (0)

Feb 28, 2005

MRTG (3)

昨日のエラー

------------------
--base: Get Device Info on hoge@localhost:
SNMP Error:
no response received
SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)
community: "hoge"
request ID: -1463006289
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /usr/local/mrtg-2/bin/../lib/mrtg2/SNMP_util.pm line 627
SNMPWALK Problem for 1.3.6.1.2.1.1 on hoge@localhost::::::v4only
at /usr/local/mrtg-2/bin/cfgmaker line 796
WARNING: Skipping hoge@localhost: as no info could be retrieved
------------------

未だ解読できず、、、
cfgmakerなしでcfg fileの作成をしようかなぁと思う今日このごろ

| | Comments (0) | TrackBack (0)

Feb 27, 2005

MRTG (2)

--参考にさせていただいたページ
SNMPによるネットワークモニタリング

パソコンおやじ
http://www.aconus.com/~oyaji/

ありがとうございます。

--MRTG insatall
# tar xvfz mrtg-2.11.1.tar.gz
# cd mrtg-2.11.1
# ./configaure
# make
# make install

注)libpng-develとgd-develもインストール

--MRTG setting
# mkdir /home/httpd/html/mrtg
# mkdir /home/httpd/html/mrtg/images
# mkdir /home/httpd/html/mrtg/icons
# cp /usr/local/mrtg-2/share/mrtg2/icons/*.png /home/httpd/html/mrtg/icons
# mkdir -p /usr/local/mrtg-2/data //ココに設定ファイルを
# mkdir -p /usr/local/mrtg-2/logs //ココにLogファイルを

--MRTG cfg file 作成
# /usr/local/mrtg-2/bin/cfgmaker hoge@localhost > /usr/local/mrtg-2/data/mrtg.cfg

しかし、エラーが起きる、、、

| | Comments (0) | TrackBack (0)

Feb 26, 2005

MRTG (1)

--必要なソフト一覧
ucd(net)-snmp: SNMPエージェント
mrtg: SNMPマネージャ・グラフ化ツール
perl: mrtgはperlで記述されている
gd: グラフィック描画用ライブラリ
libpng: PNG形式のイメージ作成用ライブラリ
zlib: 圧縮ライブラリ
crond: 定期起動用デーモン
apt-getもしくはSynapticでインストールしましょう。
MRTGはMRTG日本語からDLしましょう。

--SNMPの設定
# vi /etc/snmp/snmp.conf

--------------------------------
####
# First, map the community name "public" into a "security name"
# sec.name source community
com2sec local localhost hoge
#com2sec 192.168.0.0/24 hoge


####
# Second, map the security name into a group name:

# groupName securityModel securityName
group MyROGroup v1 local
group MyROGroup v2c local
group MyROGroup usm local

####
# Third, create a view for us to let the group have rights to:

# name incl/excl subtree mask(optional)
view all include .1 80

####
# Finally, grant the group read-only access to the systemview view.

# group context sec.model sec.level prefix read write notif
access MyROGroup "" any noauth exact al none none
--------------------------------
コメントアウトの無い行を変更または追加しました。

| | Comments (0) | TrackBack (0)