Page 2 of 2

Re: Incorrect Value for Memory Usage in Metrics

Posted: Thu Mar 02, 2017 1:19 pm
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.

Re: Incorrect Value for Memory Usage in Metrics

Posted: Thu Mar 02, 2017 1:28 pm
by ssax
Please send me this command from the AIX box:

Code: Select all

free -m

Re: Incorrect Value for Memory Usage in Metrics

Posted: Thu Mar 09, 2017 6:53 am
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

Re: Incorrect Value for Memory Usage in Metrics

Posted: Thu Mar 09, 2017 6:18 pm
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

Re: Incorrect Value for Memory Usage in Metrics

Posted: Fri Mar 10, 2017 2:36 am
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.

Re: Incorrect Value for Memory Usage in Metrics

Posted: Fri Mar 10, 2017 3:34 pm
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

Re: Incorrect Value for Memory Usage in Metrics

Posted: Wed Mar 15, 2017 1:08 am
by sarfarosh
Hi ssax,
Any update on the issue. Is the issue resolved ?

Re: Incorrect Value for Memory Usage in Metrics

Posted: Wed Mar 15, 2017 3:24 pm
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

Re: Incorrect Value for Memory Usage in Metrics

Posted: Fri Mar 17, 2017 9:54 am
by ssax
Locking as we've received the ticket, we will continue support through the ticket.

Thank you