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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
muammer
Posts: 13
Joined: Tue Jul 07, 2015 7:55 am

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

Post 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
Attachments
win1.png
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

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

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
muammer
Posts: 13
Joined: Tue Jul 07, 2015 7:55 am

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

Post 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.
Attachments
win2.png
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

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

Post by tgriep »

Thanks for the feedback. Shall we close the post?
Be sure to check out our Knowledgebase for helpful articles and solutions!
muammer
Posts: 13
Joined: Tue Jul 07, 2015 7:55 am

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

Post by muammer »

Yes please close it.
Locked