Page 1 of 1

To get ram usage in terms of gigabyte (GB) for windows

Posted: Tue Aug 04, 2015 7:26 am
by muammer
Hello all,
I am trying to configure Nagios 4.08 for monitoring both Windows and Linux machines in our network. Attached an output of test configuration of windows machine.
I want to get memory values in two part; physical and total memory and terms in GB. To get the values in GB I use check_nrpe command like below because check_nt not shows values in GB.

Services defined in Nagios as;

define service{
use generic-service
host_name Muammer_pc
service_description NRPE-RAM Usage Total
check_command check_nrpe!alias_mem_tot
}

define service{
use generic-service
host_name Muammer_pc
service_description NRPE-RAM Usage Physical
check_command check_nrpe!alias_mem_phy
}

and aliases defined in the nsclient.ini as;

alias_mem_phy = checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical
alias_mem_tot = checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged type=page

Questions:
1. Test machine has 4GB physical memory and alias_mem_phy shows 3.59GB. May this value be true?
2. alias_mem_tot gives some values like "virtual memory: Total: 8T - Used: 361M (0%) - Free: 8T (100%)". What these 8T and 361M values stands for?
3. How can I get total memory usage in GB for windows hosts?

Any help appreciated.
Muammer

Re: To get ram usage in terms of gigabyte (GB) for windows

Posted: Tue Aug 04, 2015 11:05 am
by jdalrymple
I've noticed that same weird behavior in the NRPE check, you might want to use the check_nt version. Is that a possibility for you, I think it clears up that issue:

Code: Select all

[jdalrymple@localhost ~]$ /usr/local/nagios/libexec/check_nt -H windowsbox.domain.local -s secret -p 12489 -v MEMUSE -w 80 -c 90
Memory usage: total:32582.75 MB - used: 17591.65 MB (54%) - free: 14991.10 MB (46%) | 'Memory usage'=17591.65MB;26066.20;29324.48;0.00;32582.75

Re: To get ram usage in terms of gigabyte (GB) for windows

Posted: Tue Aug 04, 2015 6:51 pm
by Box293
In NSClient++ 0.4.3.x versions there is a new memory check called check_memory. http://docs.nsclient.org/reference/wind ... eck-memory

This might solve your problem perhaps?

Command:
check_nrpe -H win2008r2-01 -c check_memory -a 'warn=used>80%' 'crit=used>90%' type=physical 'detail-syntax=${type} free: ${free} used: ${used} size: ${size}'

Output:
OK: physical free: 2.816GB used: 1.184GB size: 4GB|'physical'=1.18399GB;3.1996;3.59955;0;3.9995 'physical %'=29%;80;90;0;100
muammer wrote:1. Test machine has 4GB physical memory and alias_mem_phy shows 3.59GB. May this value be true?
Is this a VM or a physical machine? Sometimes in physical machines memory is allocated to the video card.
muammer wrote:2. alias_mem_tot gives some values like "virtual memory: Total: 8T - Used: 361M (0%) - Free: 8T (100%)". What these 8T and 361M values stands for?
Virtual memory is the page file. It's unusual, but it's possible Windows has allocated a page file 8TB in size (unlikely).

What version of NSClient++ are you using?

Re: To get ram usage in terms of gigabyte (GB) for windows

Posted: Thu Aug 06, 2015 3:21 am
by muammer
Thanks jdalrymple and Box293 for your feedback.

I am using NSClient++ 0.4.1.90 version. Installed and tried 0.4.30 version, but struggled to find an available solution to show up total memory usage in GB for windows machines. Anyway, at the end I decided to use for total memory usage as check_nt, and physical usage as check_nrpe command. What I did is;

In host service .cfg file
define service{
use generic-service
host_name xxx_pc
service_description RAM Usage Physical-nrpe
check_command check_nrpe_mem_phy
}

define service{
use generic-service
host_name xxx_pc
service_description RAM Usage Total-check_nt
check_command check_nt!MEMUSE!-w 80 -c 90
}

In commands.cfg file added the new command
define command{
command_name check_nrpe_mem_phy
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -c checkMem -a MaxWarn=80% MaxCrit=90% ShowAll=long type=physical
}


Thanks for your valuable support.

Re: To get ram usage in terms of gigabyte (GB) for windows

Posted: Thu Aug 06, 2015 9:37 am
by tgriep
Thanks for the feedback. Shall we close the post?

Re: To get ram usage in terms of gigabyte (GB) for windows

Posted: Tue Oct 20, 2015 3:57 am
by muammer
Yes please close it.