Wed. Dec 4th, 2019

Host your Website

Read and learn

FatCow Web Hosting $1.00/mo* Trust your web hosting to the #1 web host provider, GoDaddy!

Fixing Lack of Free Swap Space Error on Zabbix Server

2 min read



This video is a preview of my full Zabbix Course at
https://skl.sh/32TB2YP
Join now and you will also get an extra 2 months Premium Access for Free to all other SkillShare courses.

My Zabbix server is reporting a lack of free swap space. It probably means that the system requires more physical memory.
My server only has 1GB of RAM, but if I create a 2GB swap file, Zabbix Server will think it has 2GBs of RAM.
When creating a swap file, create it twice the size of your available RAM.

The commands.
———————————
Check if I have a swap already
$ sudo swapon -s

Double checked using free
$ free -m

List available disks to see which I want to use for the new swap
$ df -h

Choose my disk, then allocate 2gb to a new file called swapfile
$ sudo fallocate -l 2G /swapfile

Verify it now exists
$ ls -lh /swapfile

Adjust permissions so only root can use it
$ sudo chmod 600 /swapfile

Verify changes again
$ ls -lh /swapfile

Convert it to a real swapfile
$ sudo mkswap /swapfile

Turn it on
$ sudo swapon /swapfile

Checked it’s usage
$ sudo swapon -s

Checked it using free
$ free -m

Now make it permanent in case of reboot
$ sudo nano /etc/fstab

Add line below to fstab
/swapfile none swap sw 0 0

Press Ctrl X, then Y to overwrite, then enter to save.

Go back to Zabbix-Server and you will see that the problem has been fixed.

Thanks for watching, remember to like, comment, subscribe and share,

3 thoughts on “Fixing Lack of Free Swap Space Error on Zabbix Server

Comments are closed.

Copyright © All rights reserved. | Newsphere by AF themes.