Ubuntu 中怎么实现mrtg交换分区

发布时间:2021-08-11 11:57 来源:亿速云 阅读:0 作者:Leah 栏目: 系统运维 欢迎投稿:712375056

这篇文章将为大家详细讲解有关Ubuntu 中怎么实现mrtg交换分区,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。


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 

免责声明:本站发布的内容(图片、视频和文字)以原创、来自本网站内容采集于网络互联网转载等其它媒体和分享为主,内容观点不代表本网站立场,如侵犯了原作者的版权,请告知一经查实,将立刻删除涉嫌侵权内容,联系我们QQ:712375056,同时欢迎投稿传递力量。