Add memory plugin in the nagios

The memory plugin does not come by default in nagios. So we have to install it and make it working to monitor memory stats.

Server Side configuration:

After download the check_mem script put it in the plugin folder, as per my case it is in

(Path)# /usr/local/nagios/libexec/check_mem

- Add the below define command code in the commands.cfg file

(Path)# /usr/local/nagios/etc/objects/commands.cfg

define command { 
command_name check_nrpe_memory 
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c memory 

After this define the service of memory in your monitoring file. In my case the path is
(Path) # /usr/local/nagios/etc/objects/myhost.cfg

define service{
        use                                   local-service         
        host_name                       myhost
        service_description         Memory
check_command check_nrpe!check_mem


# service nagios restart

Client Side Configuration:

Add the same script on the client side in the same path

(Path) # /usr/local/nagios/libexec/
#chmod +x

Add the below line in the nrpe.cfg file

command[check_mem]=/usr/local/nagios/libexec/check_mem -w 20 -c 10

Now you can see the memory service in the nagios web panel under your host. You can also check the whether the service is working or not by the below command.

/usr/local/nagios/libexec/check_nrpe -H IP_Address -c check_mem