Get the App
SLTechnology News&Howtos  ›  Servers  › 

How does Ubuntu mrtg swap partitions

Shulou Source: shulou.com Published: 2022-06-01 17:36:54 10月04日 Update

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!

Tags: Software management content users scripts software packages learning practical deeper same interest at the same time graphics practicality practical interface simple operation files methods more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi macOS NVidia Shulou Information Microsoft