Page 1 of 2

Question with check_mem

Posted: Tue Dec 03, 2019 4:26 am
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

Re: Question with check_mem

Posted: Tue Dec 03, 2019 8:05 am
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?

Re: Question with check_mem

Posted: Wed Dec 04, 2019 5:41 am
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

Re: Question with check_mem

Posted: Wed Dec 04, 2019 7:50 am
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

Re: Question with check_mem

Posted: Wed Dec 04, 2019 8:51 am
by Leoncia
I want to see just the virtual memory. For what I see in the page, NCPA can do it, isn't?

Re: Question with check_mem

Posted: Wed Dec 04, 2019 9:01 am
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

Re: Question with check_mem

Posted: Wed Dec 04, 2019 9:22 am
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.

Re: Question with check_mem

Posted: Wed Dec 04, 2019 9:30 am
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

Re: Question with check_mem

Posted: Wed Dec 04, 2019 10:47 am
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

Re: Question with check_mem

Posted: Wed Dec 04, 2019 10:53 am
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++