Question with check_mem

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.
Leoncia

Question with check_mem

Post by Leoncia »

Hi,

I have a problem with the check_mem. When I monitor a service memory with this check, it checks the virtual memory plus the physical memory and I just want to know the Virutal memory; is there a type of argument for this check to achieve this?

I have Nagios XI and I am using check_nrpe and later in the argument I call the check_memory

Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Question with check_mem

Post by scottwilkerson »

Hello and welcome to the forum!

Are you using a windows system or Linux system? If Linux, can you attach the plugin you are using?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Leoncia

Re: Question with check_mem

Post by Leoncia »

Hi!

Thank you for the welcoming :)

Well, I am using a Linux system and the plugin I am using is check_nt and the command line that I use is this one:

$USER1$/check_nt -H $HOSTADDRESS$ -s "$ARG1$" -p 12489 -v $ARG2$ $ARG3$ $ARG4$

Later in the argument 2 I am using "MEMUSE"

Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Question with check_mem

Post by scottwilkerson »

To remove virtual memory you are going to want to use check_nrpe, see an example here
https://support.nagios.com/kb/article.php?id=774
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Leoncia

Re: Question with check_mem

Post by Leoncia »

I want to see just the virtual memory. For what I see in the page, NCPA can do it, isn't?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Question with check_mem

Post by scottwilkerson »

Leoncia wrote:I want to see just the virtual memory. For what I see in the page, NCPA can do it, isn't?
Yes, but NSClient can too, listed on that page in this section:
NSClient++ via check_nrpe
To only check the physical memory the type= argument can be used:
Command:

Code: Select all

./check_nrpe -H 10.25.14.10 -c check_memory -a type=physical 'warn=free<20%' 'crit=free<10%'
Output:

Code: Select all

OK: physical = 2.101GB|'physical'=3.89902GB;1.19991;0.59995;0;5.99956 'physical %'=64%;19;9;0;100
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Leoncia

Re: Question with check_mem

Post by Leoncia »

I did a new command and I wrote the next line:

$USER1$/check_nrpe -H $HOSTADDRESS$ -c check_memory -a type=virtual MaxWarn=$ARG1$ MaxCrit=$ARG2$

And it says:

CHECK_NRPE: Invalid packet type received from server.

I try it too with the type=physical and says the same thing.

I have correct connetion to the port 5666:

telnet 10.16.70.200 5666
Trying 10.16.70.200...
Connected to 10.16.70.200.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Question with check_mem

Post by scottwilkerson »

Try this

Code: Select all

$USER1$/check_nrpe -H $HOSTADDRESS$ -c check_memory -a  type=physical 'warn=used>$ARG1$%' 'crit=used>$ARG2$%'
where
$ARG1$ = 80
$ARG2$ = 90
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Leoncia

Re: Question with check_mem

Post by Leoncia »

It works perfectly in the service that I was testing:

OK: |'virtual'=0.00011TB;102.4;115.2;0;128 'virtual %'=0%;79;89;0;100

But, I try to copy it to other hosts and reponds the next:

Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).

I think it's because of the nsclient.ini, that in the first one there is something that in others is not
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Question with check_mem

Post by scottwilkerson »

in the section

Code: Select all

[/settings/NRPE/server]
You need

Code: Select all

allow nasty characters = 1
allow arguments = 1
then you will need to restart nsclient++
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked