Incorrect Value for Memory Usage in Metrics

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
sarfarosh
Posts: 211
Joined: Fri Oct 05, 2012 3:56 am

Incorrect Value for Memory Usage in Metrics

Post 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.
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Incorrect Value for Memory Usage in Metrics

Post by rkennedy »

Can you post the service definitions associated with all of these services we can attempt to re-create this in house?
Former Nagios Employee
sarfarosh
Posts: 211
Joined: Fri Oct 05, 2012 3:56 am

Re: Incorrect Value for Memory Usage in Metrics

Post by sarfarosh »

Hello Rkennedy,
Please find the attatchment for service definitions on both Ubuntu and AIX.

Thank you :-)
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Incorrect Value for Memory Usage in Metrics

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
sarfarosh
Posts: 211
Joined: Fri Oct 05, 2012 3:56 am

Re: Incorrect Value for Memory Usage in Metrics

Post 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
==============================================
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Incorrect Value for Memory Usage in Metrics

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
sarfarosh
Posts: 211
Joined: Fri Oct 05, 2012 3:56 am

Re: Incorrect Value for Memory Usage in Metrics

Post by sarfarosh »

Hello,
Please find the attached nrpe and common cfg's from ubuntu box.
Thank You.
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Incorrect Value for Memory Usage in Metrics

Post 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
sarfarosh
Posts: 211
Joined: Fri Oct 05, 2012 3:56 am

Re: Incorrect Value for Memory Usage in Metrics

Post by sarfarosh »

Hello ssax,
Thank you for all your support. Please provide some solution.
sarfarosh
Posts: 211
Joined: Fri Oct 05, 2012 3:56 am

Re: Incorrect Value for Memory Usage in Metrics

Post by sarfarosh »

Hello ssax,
When can i expect the solution to this issue, because its creating a mess in the metrics for us.
Locked