Page 1 of 2

Incorrect Value for Memory Usage in Metrics

Posted: Tue Jan 31, 2017 6:30 am
by sarfarosh
Hi,
I am getting incorrect values for linux hosts in Nagios XI, Metrics --> Memory USage--> Linux Hosts--> %Utilization. Please find the attached screenshot and comments on the file. Hope this helps.

Re: Incorrect Value for Memory Usage in Metrics

Posted: Tue Jan 31, 2017 2:27 pm
by rkennedy
Can you post the service definitions associated with all of these services we can attempt to re-create this in house?

Re: Incorrect Value for Memory Usage in Metrics

Posted: Mon Feb 13, 2017 5:04 am
by sarfarosh
Hello Rkennedy,
Please find the attatchment for service definitions on both Ubuntu and AIX.

Thank you :-)

Re: Incorrect Value for Memory Usage in Metrics

Posted: Mon Feb 13, 2017 11:11 am
by lmiltchev
How did you install the Linux agent (NRPE + Nagios plugins) on the Ubuntu and AIX box? Did you use our official Linux agent installer or use some other method (compile from source, repo install)?

How is "check_mem" command configured on the client (remote box)? You can find the command definition either in the "nrpe.cfg" or/and "common.cfg" file. Can you post both files?

Let's see what the output is going to be when you run the check locally (on the remote machine). Run the following commands on the Ubuntu box, and show the output:

Code: Select all

free -m
head /usr/local/nagios/libexec/custom_check_mem
/usr/local/nagios/libexec/custom_check_mem -w 20 -c 10
/usr/local/nagios/libexec/custom_check_mem -w 20 -c 10 -n
Note: Modify the path to the plugin if different on your system.

Do the same on the AIX box. I believe you can check the memory by running:

Code: Select all

svmon

Re: Incorrect Value for Memory Usage in Metrics

Posted: Thu Feb 16, 2017 7:38 am
by sarfarosh
Hi,
Please find the attached config files and output from AIX/Ubuntu servers.

AIX Output:

Code: Select all

==============================================
bash-4.3# svmon
               size       inuse        free         pin     virtual   mmode
memory      1048576      334834      713742      238465      310796     Ded
pg space     131072        2742

               work        pers        clnt       other
pin          200021           0        2108       36336
in use       310796           0       24038

PageSize   PoolSize       inuse        pgsp         pin     virtual
s    4 KB         -      103858        2742       70849       79820
m   64 KB         -       14436           0       10476       14436
L   16 MB         -           0           0           0           0
S   16 GB         -           0           0           0           0

bash-4.3# head /opt/nagios/libexec/custom_check_mem
#!/bin/bash
# Script to check real memory usage
# L.Gill 02/05/06 - V.1.0
# ------------------------------------------
# ########  Script Modifications  ##########
# ------------------------------------------
# Who    When      What
# ---    ----      ----
# LGill  17/05/06  "$percent" lt 1% fix - sed edits dc result beggining with "."
#

bash-4.3# /opt/nagios/libexec/custom_check_mem -w 20 -c 10
OK - 2755 / 4096 MB (67%) Free Memory, In Use: 1340 MB, Pinned: 963 MB | total=4096MB free=2755MB inuse=1340MB pinned=963MB

bash-4.3# /opt/nagios/libexec/custom_check_mem -w 20 -c 10 -n
OK - 2755 / 4096 MB (67%) Free Memory, In Use: 1340 MB, Pinned: 963 MB | total=4096MB free=2755MB inuse=1340MB pinned=963MB
==============================================

Ubuntu Output

Code: Select all

==============================================
root@OTRS-NEW:~# free -m
             total       used       free     shared    buffers     cached
Mem:          4218        983       3234          0        190        370
-/+ buffers/cache:        422       3796
Swap:         4367          0       4367

root@OTRS-NEW:~# head /usr/local/nagios/libexec/custom_check_mem
#!/bin/bash
# Script to check real memory usage
# L.Gill 02/05/06 - V.1.0
# ------------------------------------------
# ########  Script Modifications  ##########
# ------------------------------------------
# Who    When      What
# ---    ----      ----
# LGill  17/05/06  "$percent" lt 1% fix - sed edits dc result beggining with "."
#

root@OTRS-NEW:~# /usr/local/nagios/libexec/custom_check_mem -w 20 -c 10
OK - 3231 / 4218 MB (76%) Free Memory, Used: 987 MB, Shared: 0 MB, Buffers: 190 MB, Cached: 373 MB | total=4218MB free=3231MB used=987MB shared=0 buffers=190MB cached=373MB

root@OTRS-NEW:~# /usr/local/nagios/libexec/custom_check_mem -w 20 -c 10 -n                                                                                              OK - 3604 / 4218 MB (85%) Free Memory, Used: 987 MB, Shared: 0 MB, Buffers: 190 MB, Cached: 373 MB | total=4218MB free=3604MB used=987MB shared=0 buffers=190MB cached=373MB
==============================================

Re: Incorrect Value for Memory Usage in Metrics

Posted: Thu Feb 16, 2017 4:54 pm
by lmiltchev
Let's troubleshoot the Ubuntu box first. The output from the "custom_check_mem" plugin looks correct. You have:

Code: Select all

total 	used 	free	shared 	buffers cached
4218 	 983 	 3234   0 		  190 	 370
and the plugin's output is:

(free / total) * 100 - cached mem is not added to the free mem

Code: Select all

root@OTRS-NEW:~# /usr/local/nagios/libexec/custom_check_mem -w 20 -c 10
OK - 3231 / 4218 MB (76%) Free Memory, Used: 987 MB, Shared: 0 MB, Buffers: 190 MB, Cached: 373 MB | total=4218MB free=3231MB used=987MB shared=0 buffers=190MB cached=373MB
((free + cached) / total) * 100 - cached mem is added to the free mem

Code: Select all

root@OTRS-NEW:~# /usr/local/nagios/libexec/custom_check_mem -w 20 -c 10 -n 
OK - 3604 / 4218 MB (85%) Free Memory, Used: 987 MB, Shared: 0 MB, Buffers: 190 MB, Cached: 373 MB | total=4218MB free=3604MB used=987MB shared=0 buffers=190MB cached=373MB
Note: I wanted to see now "check_mem" was configured on the client (remote box). I asked for the nrpe.cfg and common.cfg (if present) from the remote machines. The provided files are nrpe.cfg and commands.cfg from the Nagios XI server, which don't contain the information we need.
Once you show us how the "check_mem" command is configured on the remote boxes, we can run a test from the Nagios XI server to verify the output.

Re: Incorrect Value for Memory Usage in Metrics

Posted: Thu Feb 23, 2017 4:47 am
by sarfarosh
Hello,
Please find the attached nrpe and common cfg's from ubuntu box.
Thank You.

Re: Incorrect Value for Memory Usage in Metrics

Posted: Thu Feb 23, 2017 12:30 pm
by ssax
I think there is a bug in the metrics code, I'm experiencing the same issue, I will let you know what I find.

Thank you

Re: Incorrect Value for Memory Usage in Metrics

Posted: Thu Mar 02, 2017 12:50 am
by sarfarosh
Hello ssax,
Thank you for all your support. Please provide some solution.

Re: Incorrect Value for Memory Usage in Metrics

Posted: Thu Mar 02, 2017 6:41 am
by sarfarosh
Hello ssax,
When can i expect the solution to this issue, because its creating a mess in the metrics for us.