memory usage detected wrong for the host system

Issue #430 duplicate
Lukas Schreiner created an issue

Due to bug #379 i had to use older version or the master branch. Right now i'm using the master branch with ref. 27210ed610ba

To the bug. My config:

check system localhost.local
    if loadavg (1min) > 4 for 2 cycles then alert
    if loadavg (5min) > 2 for 2 cycles then alert
    if memory usage > 95% for 2 cycles then alert
    if cpu usage (user) > 90% for 4 cycles then alert
    if cpu usage (system) > 80% for 4 cycles then alert
    if cpu usage (wait) > 80% for 4 cycles then alert
    if swap usage > 85% for 1 cycles then alert

If the memory usage is > 95% i want an alert. But it is now always complaining:

System 'localhost.local'
  status                       Resource limit matched
  monitoring status            Monitored
  monitoring mode              active
  on reboot                    start
  load average                 [0.00] [0.07] [0.09]
  cpu                          2.4%us 1.8%sy 0.4%wa
  memory usage                 16.0 EB [1717986918400.0%]
  swap usage                   0 B [0.0%]
  uptime                       171d 16h 52m
  boot time                    Wed, 10 Feb 2016 03:17:47
  data collected               Sat, 30 Jul 2016 21:09:41

16.0 EB [1717986918400.0%] is a little bit high. Output of free:

             total       used       free     shared    buffers     cached
Mem:       1048576    1048576          0      97040          0     534608
-/+ buffers/cache:     513968     534608
Swap:      1048576          0    1048576

Note: this server is running via Linux-vServer - on my KVM servers its running without problems.

I had before the version 1.15 of monit. With that version, it worked out of the box.

If you need further information, let me know.

Thanks!

Comments (9)

  1. Lukas Schreiner reporter

    OK.. have to correct me. Issue is already in monit version 5.15. But the output is different:

    The Monit daemon 5.15 uptime: 0m 
    
    System 'localhost.local'
      status                            Running
      monitoring status                 Monitored
      load average                      [0.70] [0.34] [0.15]
      cpu                               0.0%us 0.0%sy 0.0%wa
      memory usage                      16.0 ZB [0.0%]
      swap usage                        0 B [0.0%]
      data collected                    Sat, 30 Jul 2016 23:20:14
    

    Same for 5.14.

    Monit 5.10 it was negative:

    The Monit daemon 5.10 uptime: 0m 
    
    System 'localhost.local'
      status                            Running
      monitoring status                 Monitored
      load average                      [0.68] [0.48] [0.27]
      cpu                               0.0%us 0.0%sy 0.0%wa
      memory usage                      16.0 ZB [-214748364.8%]
      swap usage                        0.0 B [0.0%]
      data collected                    Sat, 30 Jul 2016 23:28:20
    
  2. Lukas Schreiner reporter
    # cat /proc/meminfo
    MemTotal:        1048576 kB
    MemFree:               0 kB
    Buffers:               0 kB
    Cached:           454544 kB
    SwapCached:       435112 kB
    Active:          8960756 kB
    Inactive:        3675180 kB
    Active(anon):    3814280 kB
    Inactive(anon):  1209144 kB
    Active(file):    5146476 kB
    Inactive(file):  2466036 kB
    Unevictable:           0 kB
    Mlocked:               0 kB
    SwapTotal:       1048576 kB
    SwapFree:        1048576 kB
    Dirty:              1948 kB
    Writeback:             0 kB
    AnonPages:       4557128 kB
    Mapped:           320948 kB
    Shmem:             97008 kB
    Slab:            2911940 kB
    SReclaimable:    2498852 kB
    SUnreclaim:       413088 kB
    KernelStack:        9728 kB
    PageTables:       100776 kB
    NFS_Unstable:          0 kB
    Bounce:                0 kB
    WritebackTmp:          0 kB
    CommitLimit:    25187216 kB
    Committed_AS:    9964672 kB
    VmallocTotal:   34359738367 kB
    VmallocUsed:       51564 kB
    VmallocChunk:   34359612116 kB
    HardwareCorrupted:     0 kB
    HugePages_Total:       0
    HugePages_Free:        0
    HugePages_Rsvd:        0
    HugePages_Surp:        0
    Hugepagesize:       2048 kB
    DirectMap4k:        2040 kB
    DirectMap2M:     2095104 kB
    DirectMap1G:    14680064 kB
    
  3. Lukas Schreiner reporter

    Hi, unchanged:

    root@www /u/l/s/monit# monit status localhost.local
    Monit 5.19 uptime: 1m
    
    System 'localhost.local'
      status                       Running
      monitoring status            Monitored
      monitoring mode              active
      on reboot                    start
      load average                 [0.41] [0.23] [0.09]
      cpu                          0.0%us 0.0%sy 0.0%wa
      memory usage                 16.0 EB [1717986918400.0%]
      swap usage                   0 B [0.0%]
      uptime                       172d 10h 41m
      boot time                    Wed, 10 Feb 2016 03:17:47
      data collected               Sun, 31 Jul 2016 14:59:38
    
  4. Tildeslash repo owner

    Please run Monit in debug mode monit -Iv and let me know if you can see this error message in the output, system statistic error -- cannot get real memory amount. If you see any other error messages, please let me know as well. Also try to run as root if you haven't already. I suspect that Linux-vServer either has a bug or some security type of protection, do you know? Is your server 64 bits BTW?

  5. Lukas Schreiner reporter

    Thanks for the reply. As far as i see, there is no statistics error. Also no other error. Monit is running as root.

    I understand what you mean regarding the Linux-vServer. I also had such an idea. At least we have the issue, that we cannot do things, which are near to the kernel (no own kernel, no access to driver options or to hardware, no tap/tun, no own network device; its all isolated). Of course, basic files are there (like this meminfo, cpuinfo,..)

    regarding 64 bit:

    # uname -m
    x86_64
    
  6. Log in to comment