How does Ubuntu mrtg swap partitions
This article mainly explains "how to exchange partitions in Ubuntu mrtg". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to exchange partitions with Ubuntu mrtg".
Ubuntu's software management system is the same as Debian's, using the APT management package, while there is also a graphical user interface Synaptic (Synaptic package Manager) available.
Ubuntu mrtg switching partition
Ubuntu mrtg switches to superuser:
Sudo-sH
Ubuntu mrtg create swap partition script:
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 enables scripts to execute:
Chmod + 755 / opt/mrtg/mrtg.swap
Modify / etc/mrtg.cfg to add to file *
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]: Swap
Rebuild the index page:
Indexmaker / etc/mrtg.cfg > / var/www/mrtg/index.html
At this point, I believe you have a deeper understanding of "how to exchange partitions in Ubuntu mrtg". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!