mrtg & ifInErrors問題 - BBS
By Enid
at 2011-12-13T11:05
at 2011-12-13T11:05
Table of Contents
寫script去產生
超快 ~~~
10台48 port switch 很快搞定
( 每個機器port的oid,要先準備好, 存在/tmp/xx3中 )
=====================================================================
#!/bin/bash
file=/etc/mrtg/xx.cfg
ip= (ip.address)
community=public
array=(`awk '{print $1}' /tmp/xx3`)
for (( i=1; i<=28; i=i+1 )) do
echo "Target[bps_$i]:
1.3.6.1.2.1.2.2.1.10.$i&1.3.6.1.2.1.2.2.1.16.$i:$community@$ip" >> $file
echo "MaxBytes[bps_$i]: 125000000" >> $file
echo "Title[bps_$i]: Traffic Analysis (interface $i)" >> $file
echo "PageTop[bps_$i]: Traffic Analysis (interface $i)" >> $file
echo " " >> $file
echo "Target[pps_$i]:
1.3.6.1.2.1.2.2.1.11.$i&1.3.6.1.2.1.2.2.1.17.$i:$community@$ip" >> $file
echo "MaxBytes[pps_$i]: 999999999" >> $file
echo "Colours[pps_$i]: GREEN#00ffa0,ORANGE#ffa040,DARK GREEN#003310,DARK
ORANGE#e07000" >> $file
echo "ShortLegend[pps_$i]: pps" >> $file
echo "Title[pps_$i]: Packet Analysis (interface $i)" >> $file
echo "PageTop[pps_$i]: Packet Analysis (interface $i)" >> $file
echo " " >> $file
done
========================================================================
※ 引述《[email protected] (Xiao Jin)》之銘言:
: ※ 引述《[email protected] (不敗地球人)》之銘言:
: > 修改file.cfg裡面的選項
: > 有一個是Target開頭的,大概長這樣
: > Target[ ]: 1.3.6.1.2.1.2.2.1.14.X&[email protected]
: > X是你的網卡號碼
: > http://www.oidview.com/mibs/0/IF-MIB.html 這可以查你想撈的資料代號
: sorry..這我知道..像這樣的Target大概有400多個..但想問有沒有更高效率的
: ps.其實就是24port的交換器20幾台
--
超快 ~~~
10台48 port switch 很快搞定
( 每個機器port的oid,要先準備好, 存在/tmp/xx3中 )
=====================================================================
#!/bin/bash
file=/etc/mrtg/xx.cfg
ip= (ip.address)
community=public
array=(`awk '{print $1}' /tmp/xx3`)
for (( i=1; i<=28; i=i+1 )) do
echo "Target[bps_$i]:
1.3.6.1.2.1.2.2.1.10.$i&1.3.6.1.2.1.2.2.1.16.$i:$community@$ip" >> $file
echo "MaxBytes[bps_$i]: 125000000" >> $file
echo "Title[bps_$i]: Traffic Analysis (interface $i)" >> $file
echo "PageTop[bps_$i]: Traffic Analysis (interface $i)" >> $file
echo " " >> $file
echo "Target[pps_$i]:
1.3.6.1.2.1.2.2.1.11.$i&1.3.6.1.2.1.2.2.1.17.$i:$community@$ip" >> $file
echo "MaxBytes[pps_$i]: 999999999" >> $file
echo "Colours[pps_$i]: GREEN#00ffa0,ORANGE#ffa040,DARK GREEN#003310,DARK
ORANGE#e07000" >> $file
echo "ShortLegend[pps_$i]: pps" >> $file
echo "Title[pps_$i]: Packet Analysis (interface $i)" >> $file
echo "PageTop[pps_$i]: Packet Analysis (interface $i)" >> $file
echo " " >> $file
done
========================================================================
※ 引述《[email protected] (Xiao Jin)》之銘言:
: ※ 引述《[email protected] (不敗地球人)》之銘言:
: > 修改file.cfg裡面的選項
: > 有一個是Target開頭的,大概長這樣
: > Target[ ]: 1.3.6.1.2.1.2.2.1.14.X&[email protected]
: > X是你的網卡號碼
: > http://www.oidview.com/mibs/0/IF-MIB.html 這可以查你想撈的資料代號
: sorry..這我知道..像這樣的Target大概有400多個..但想問有沒有更高效率的
: ps.其實就是24port的交換器20幾台
--
Tags:
BBS
All Comments
Related Posts
mrtg & ifInErrors問題
By Leila
at 2011-12-12T17:21
at 2011-12-12T17:21
內網架設VPN?
By William
at 2011-12-05T02:39
at 2011-12-05T02:39
pkg_add如何不要去國外抓檔案?
By Daph Bay
at 2011-12-02T22:19
at 2011-12-02T22:19
pkg_add如何不要去國外抓檔案?
By James
at 2011-12-02T15:33
at 2011-12-02T15:33
pkg_add如何不要去國外抓檔案?
By Xanthe
at 2011-12-02T08:11
at 2011-12-02T08:11