Ubuntu mrtg交換分區(qū)
Ubuntu的軟件管理系統(tǒng)與Debian的相同,俱使用APT管理軟件包,而同時亦有圖形用戶接口的Synaptic(新立得軟件包管理器)可供使用。
Ubuntu mrtg交換分區(qū)
Ubuntu mrtg切換到超級用戶:
sudo -sH
Ubuntu mrtg建立交換分區(qū)腳本:
mkdir /opt/mrtg
vim /opt/mrtg/mrtg.swap
#!/bin/bash
# This script to monitor the swap usage.
totalswap=`/usr/bin/free |grep Swap |awk '{print $2}'`
usedswap=`/usr/bin/free |grep Swap |awk '{print $3}'`
echo "$totalswap"
echo "$usedswap"
Ubuntu mrtg使腳本可以執(zhí)行:
chmod +755 /opt/mrtg/mrtg.swap
修改 /etc/mrtg.cfg 在文件***加入
Target[swap]: `/opt/mrtg/mrtg.swap`
MaxBytes[swap]: 2048000
Title[swap]:Memory State of Server
ShortLegend[swap]: &
kmg[swap]:kB,MB
kilo[swap]:1024
YLegend[swap]: Swap Usage
Legend1[swap]: Total Swap
Legend2[swap]: Used Swap
LegendI[swap]: Total Swap
LegendO[swap]: Used Swap
Options[swap]: growright,gauge,nopercent
PageTop[swap]:<H1>Swap</H1>
重新生成索引頁面:
indexmaker /etc/mrtg.cfg > /var/www/mrtg/index.html
訪問:
http://localhost/mrtg/
【編輯推薦】
- 解決Ubuntu和Fedora的“民事糾紛”
- Ubuntu不得不分享的24條使用經(jīng)驗
- 在Ubuntu 10.04上安裝私有驅(qū)動
- Ubuntu家族成員 Lubuntu輕量級桌面環(huán)境體驗
- Ubuntu小弟Jolicloud整合云計算的安裝實踐