APT管理软件包应用技巧


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 © 2016 phpStudy | 豫ICP备2021030365号-3