check_mem not work correctly

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
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

check_mem not work correctly

Post by baber »

dear all

Hi

on my linux server i use check_mem.pl plugin for chk memory plugin status

Code: Select all

command[check_mem]=/usr/local/nagios/libexec/check_mem.pl  -f -w 15 -c 10
and add this to service :

Code: Select all

define service{
        use                                       generic-service
        host_name                           ntmbsrv
        service_description             Memory
        check_command                  check_nrpe!check_mem
}


my problem is when my memory usage is high it will be appeaer critical but after 2 days server status is now ok and memory status is now decrease and is ok but my memory status is still appear critical and don't change to ok

what is problem ?

BR
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_mem not work correctly

Post by dwhitfield »

Please post your nrpe.cfg
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: check_mem not work correctly

Post by baber »

dwhitfield wrote:Please post your nrpe.cfg
This line is on remote host nrpe.cfg


command[check_mem]=/usr/local/nagios/libexec/check_mem.pl -f -w 15 -c 10
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_mem not work correctly

Post by dwhitfield »

Is that literally all that is in your nrpe.cfg? Seeing the settings will help us understand any issues you are having. If you are concerned about security, you can PM.
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: check_mem not work correctly

Post by baber »

dwhitfield wrote:Is that literally all that is in your nrpe.cfg? Seeing the settings will help us understand any issues you are having. If you are concerned about security, you can PM.

Thanks but this host using check_by_ssh not ise nrpe
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: check_mem not work correctly

Post by dwhitfield »

Did you post the right service definition? It says check_nrpe!check_mem
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: check_mem not work correctly

Post by baber »

dwhitfield wrote:Did you post the right service definition? It says check_nrpe!check_mem

Yes i hava defined service with check_mem and it is working now but problem is after 4 days percentage of memory usage that show not change in nagios but when ssh to remote host and get top command memory usage is 2% check_mem.pl plugin has problem?

BR
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_mem not work correctly

Post by rkennedy »

baber wrote:
dwhitfield wrote:Is that literally all that is in your nrpe.cfg? Seeing the settings will help us understand any issues you are having. If you are concerned about security, you can PM.

Thanks but this host using check_by_ssh not ise nrpe
You are posting an NRPE command. Please post the ENTIRE definition to avoid any further confusion.
baber wrote:dear all

Hi

on my linux server i use check_mem.pl plugin for chk memory plugin status

Code: Select all

command[check_mem]=/usr/local/nagios/libexec/check_mem.pl  -f -w 15 -c 10
and add this to service :

Code: Select all

define service{
        use                                       generic-service
        host_name                           ntmbsrv
        service_description             Memory
        check_command                  check_nrpe!check_mem
}


my problem is when my memory usage is high it will be appeaer critical but after 2 days server status is now ok and memory status is now decrease and is ok but my memory status is still appear critical and don't change to ok

what is problem ?

BR
Former Nagios Employee
baber
Posts: 308
Joined: Wed Oct 21, 2015 4:39 am

Re: check_mem not work correctly

Post by baber »

rkennedy wrote:
baber wrote:
dwhitfield wrote:Is that literally all that is in your nrpe.cfg? Seeing the settings will help us understand any issues you are having. If you are concerned about security, you can PM.

Thanks but this host using check_by_ssh not ise nrpe
You are posting an NRPE command. Please post the ENTIRE definition to avoid any further confusion.
baber wrote:dear all

Hi

on my linux server i use check_mem.pl plugin for chk memory plugin status

Code: Select all

command[check_mem]=/usr/local/nagios/libexec/check_mem.pl  -f -w 15 -c 10
and add this to service :

Code: Select all

define service{
        use                                       generic-service
        host_name                           ntmbsrv
        service_description             Memory
        check_command                  check_nrpe!check_mem
}


my problem is when my memory usage is high it will be appeaer critical but after 2 days server status is now ok and memory status is now decrease and is ok but my memory status is still appear critical and don't change to ok

what is problem ?

BR

i have added this to command.cfg file on nagios server

Code: Select all

define command{
        command_name    check_mem
        command_line    $USER1$/check_by_ssh -H $HOSTADDRESS$ -C '/usr/local/nagios/libexec/check_mem.pl -f -w 15 -c 10' -E
}

and added this on remote host for service

Code: Select all

define service{
        use                                      Mobile-service
        host_name                          npmbsrv3
        service_description            Memory
        check_command                  check_mem
}
now after 3 days status of memory on nagios show critical although my memory status is very low and attached pic from top on server why critical warning from monitoring not remove now ?


BR
Attachments
memory.jpg
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_mem not work correctly

Post by rkennedy »

You only have 150MB of memory free, I believe Nagios is reporting correctly. Take a look at the free -m command which may be a bit easier to visualize.
Former Nagios Employee
Locked