0

I installed nagios a very long time ago, and have started trying to use it now. I am getting this error:

Current Status:   CRITICAL   (for 231d 16h 52m 49s)
Status Information: SWAP CRITICAL - 100% free (0 MB out of 0 MB)
Performance Data:   swap=0MB;0;0;0;0
Current Attempt:    4/4  (HARD state)
Last Check Time:    01-09-2011 13:26:34
Check Type: ACTIVE
Check Latency / Duration:   0.125 / 0.004 seconds
Next Scheduled Check:   01-09-2011 13:31:34
Last State Change:  05-22-2010 21:36:47
Last Notification:  01-09-2011 13:01:42 (notification 5521)
Is This Service Flapping?     NO   (0.00% state change)
In Scheduled Downtime?    NO  
Last Update:    01-09-2011 13:29:32  ( 0d 0h 0m 4s ago)

Is this normal? Should I be concerned?

Ok, so I am adding this to here, cause I think I have an issue with the swap, im sure the system should be setup with raid mirror for the swap.

/etc$ cat fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/md0
UUID=b04f709c-0771-4d64-a338-53b88d7f6931 /               ext3    relatime,errors=remount-ro 0       1
# /dev/sda5
UUID=0c45d6a9-1298-4f08-90e0-92b118e87dd2 none            swap    sw              0       0
# /dev/sdb5
UUID=26b07775-a00b-46bc-b63a-bf96e9b5ad28 none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec,utf8 0       0

and,

cat /proc/mdstat 
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
md0 : active raid1 sda1[0] sdb1[1]
      238171520 blocks [2/2] [UU]

md1 : active raid1 sda5[0] sdb5[1]
      5968000 blocks [2/2] [UU]

unused devices: <none>

free:

free
             total       used       free     shared    buffers     cached 
Mem:       2026584    1350980     675604          0     296920     509544
-/+ buffers/cache:     544516    1482068
Swap:            0          0          0

swapon -a (tried it with and without sudo to be sure)

swapon -a
swapon: cannot find the device for UUID=0c45d6a9-1298-4f08-90e0-92b118e87dd2
swapon: cannot find the device for UUID=26b07775-a00b-46bc-b63a-bf96e9b5ad28

I think I must have something wrong if I have 0 swap.

If more info is needed please let me know.

Toby Joiner
  • 101
  • 2
  • 5
  • 1
    What exactly are you asking? Are you asking if this report is legitimate or not? Is your system in fact out of swap? Are you asking if it's normal to be out of swap, or what? If your system is in fact out of swap space, then yes, you would expect to see an alert. – larsks Jan 09 '11 at 22:44
  • sorry I dont know what I wanted to ask. I am trying to figure out why its giving me critical swap errors, but the next answer tells me why that is, but the big question now is, is my system messed up when there should be swap in it? – Toby Joiner Jan 10 '11 at 02:53

3 Answers3

2

Read the second line, specifically (0 MB out of 0 MB). Your system doesn't have any swap, so that alert is really a false positive unless there should be swap there.

The only systems I've seen without swap recently are OpenVZ/Virtuozzo contatiners/VPS' where there's no swap given to each container as the hardware node handles all swapping. However there are plenty of other reasons for not having any swap space setup.

Niall Donegan
  • 3,869
  • 20
  • 17
  • These are my own private servers for my work, I didn't set them up originally, and im guessing this one wasn't setup correctly in the first place. – Toby Joiner Jan 10 '11 at 02:54
0

Check the output of free. That will tell you how much swap is active. It appears from the nagios info that you don't have any swap currently active. Use swapon -a to activate it.

toppledwagon
  • 4,245
  • 25
  • 15
0

I figured this out finally:

I removed the drives from the raid.

Ran

mkswap /dev/sda5 
mkswap /dev/sdb5

Then had to do

swapon /dev/sda5 
swapon /dev/sdb5

This would not work for some reason.

swapon -a

That seemed to fix the issue.

Toby Joiner
  • 101
  • 2
  • 5