歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux服務器 >> APT管理軟件包應用技巧

APT管理軟件包應用技巧

日期:2017/3/2 16:33:29   编辑:Linux服務器

Ubuntu的軟件管理系統與Debian的相同,俱使用APT管理軟件包,而同時亦有圖形用戶接口的Synaptic(新立得軟件包管理器)可供使用。

Ubuntu mrtg交換分區

Ubuntu mrtg切換到超級用戶:

sudo -sH

Ubuntu mrtg建立交換分區腳本:

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使腳本可以執行:

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/

Copyright © Linux教程網 All Rights Reserved