RT58iの統計をmrtgで取る

MRTGでRT58i○トラフィック統計
スクリプト1を作成
#!/bin/sh
/usr/bin/wget –http-user=ユーザ名 –http-passwd=パスワード “RT58iのIPアドレス/detail/status.html” -O /tmp/status.txt -q
/bin/cat /tmp/status.txt | grep ‘.*%.*’ | € /usr/bin/tail -2 | € /usr/bin/cut -d [ -f 2 | /usr/bin/cut -d ] -f 1 € | /usr/bin/cut -d ‘ ‘ -f 1
 
/etc/mrtg.cfg に以下を追加
Title[RT58i1]: RT58i Traffic
Target[RT58i1]: `スクリプト1`
PageTop[RT58i1]: <h1>RT58i Traffic</h1>
MaxBytes[RT58i1]: 9000000000
YLegend[RT58i1]: Bytes per Second
ShortLegend[RT58i1]: Bytes per Second
Options[RT58i1]: € integer
 
○負荷統計
スクリプト2を作成
#!/bin/sh
/usr/bin/wget –http-user=ユーザ名 –http-passwd=パスワード “RT58iのIPアドレス/detail/status.html” -O /tmp/status.txt -q
/bin/cat /tmp/status.txt | grep ‘.*%.*’ | € /usr/bin/tail -2 | € /usr/bin/cut -c 56- | /usr/bin/cut -d % -f 1
 
/etc/mrtg.cfg に以下を追加
Title[RT58i2]: RT58i load Average
Target[RT58i2]: `スクリプト2`
PageTop[RT58i2]: <h1>RT58i load Average</h1>
MaxBytes[RT58i2]: 100
YLegend[RT58i2]: RT58i Load Avg.
ShortLegend[RT58i2]: percent
Options[RT58i2]: nopercent,gauge
 
mrtg.cfgを修正したあとは以下のコマンドを忘れずに。
indexmaker /etc/mrtg.cfg > /mrtg出力パス/index.htm
/usr/bin/mrtg /etc/mrtg.cfg

++++++++
 
<関連記事>
RT58iのアクティブなNATセッション数を視覚化?
 http://raku.8ware.com/archives/2793

Comments are closed.