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.
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'll send you answer shortly, I'm going to have to import the data into the plugin so that I can see what needs changing for it to work, I'm pretty sure we just need to change inuse= to used= so it gets picked up.
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 »

Please send me this command from the AIX box:

Code: Select all

free -m
sarfarosh
Posts: 211
Joined: Fri Oct 05, 2012 3:56 am

Re: Incorrect Value for Memory Usage in Metrics

Post by sarfarosh »

Hi ssax,
Free -m is not working for AIX.
Please find below the output of svmon.

Code: Select all

# free -m
ksh: free:  not found
# bash
bash-4.3# free -m
bash: free: command not found
bash-4.3# svmon
               size       inuse        free         pin     virtual   mmode
memory      1048576      346546      702030      247151      320671     Ded
pg space     131072        2879

               work        pers        clnt       other
pin          208643           0        2108       36400
in use       320671           0       25875

PageSize   PoolSize       inuse        pgsp         pin     virtual
s    4 KB         -      105938        2879       71055       80063
m   64 KB         -       15038           0       11006       15038
L   16 MB         -           0           0           0           0
S   16 GB         -           0           0           0           0
Last edited by tmcdonald on Thu Mar 09, 2017 5:39 pm, edited 1 time in total.
Reason: Please use [code][/code] tags around terminal output
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 »

Ok, I see, the AIX plugin is different.

For testing, on the AIX machine, please edit /usr/local/nagios/libexec/custom_check_mem and change these lines:

Code: Select all

	AIX)
		echo "$string - $free / $total MB ($percent%) Free Memory, In Use: $inuse MB, Pinned: $pinned MB | total="$total"MB free="$free"MB inuse="$inuse"MB pinned="$pinned"MB"
		;;
To:

Code: Select all

	AIX)
		echo "$string - $free / $total MB ($percent%) Free Memory, In Use: $inuse MB, Pinned: $pinned MB | total="$total"MB free="$free"MB used="$inuse"MB pinned="$pinned"MB"
		;;

Then force a check and see if it's showing properly and let us know the results.

For the Ubuntu ones, the reason why it's showing wrong is because it's showing % USED in XI and it's showing % FREE in the output, so for this one:

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
XI would use this calculation: (987 / 4218) * 100 = 23.39971550497866 = 23% Used

The plugin shows the (NUM%): (3231 / 4218) * 100 = 76.60028449502134 = 76% Free

So the XI metrics page shows percent used and the plugin output on percent free, that would be why.


Thank you
sarfarosh
Posts: 211
Joined: Fri Oct 05, 2012 3:56 am

Re: Incorrect Value for Memory Usage in Metrics

Post by sarfarosh »

Hi ssax,
AIX:
i have tried as suggested by you. But issue still persists. Infact it shows 0% in %Utilization. Please find the attachments of before and after changes in plugin.
Ubuntu:
I am not sure where to make changes to get the correct %Utilization. Please guide.
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'm importing these into my system (with your exact output) and I will find a resolution for you, I'm about 90% done with the code changes but I need to talk with the devs on why they are still not showing up properly, I will let you know on Monday. If you don't hear from me by end of day Monday please respond to this post so that it pops up on our dashboard.

Thank you
sarfarosh
Posts: 211
Joined: Fri Oct 05, 2012 3:56 am

Re: Incorrect Value for Memory Usage in Metrics

Post by sarfarosh »

Hi ssax,
Any update on the issue. Is the issue resolved ?
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 »

Let's move this into a ticket, please email [email protected] with a descriptive subject and detailed body and please include a link back to this thread so that we can get a remote session setup.

Thank you
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 »

Locking as we've received the ticket, we will continue support through the ticket.

Thank you
Locked