Page 1 of 2

How Does NRPE Calculate Memory

Posted: Wed May 08, 2019 8:04 am
by mkeey
I have the Nagios Agent installed on Linux servers. It appears that the numbers do not match (see attached screen print). How does the agent calculate memory?

Re: How Does NRPE Calculate Memory

Posted: Wed May 08, 2019 9:14 am
by scottwilkerson
Can you share the /usr/local/nagios/etc/nrpe/common.cfg from the remote server as well as the configuration for this service?

Re: How Does NRPE Calculate Memory

Posted: Wed May 08, 2019 11:23 am
by mkeey
As requested...


[MYUSER@PROBLEMCHILD]:[/usr/local/nagios/etc/nrpe]# more common.cfg

### GENERIC SERVICES ###
command[check_init_service]=sudo /usr/local/nagios/libexec/check_init_service $A
RG1$
command[check_services]=/usr/local/nagios/libexec/check_services -p $ARG1$

### MISC SYSTEM METRICS ###
#command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_users]=/usr/local/nagios/libexec/check_users $ARG1$
command[check_load]=/usr/local/nagios/libexec/check_load $ARG1$
command[check_swap]=/usr/local/nagios/libexec/check_swap $ARG1$
command[check_cpu_stats]=/usr/local/nagios/libexec/check_cpu_stats.sh $ARG1$
command[check_mem]=/usr/local/nagios/libexec/custom_check_mem -n $ARG1$

### SYSTEM UPDATES ###
command[check_yum]=/usr/local/nagios/libexec/check_yum
command[check_apt]=/usr/local/nagios/libexec/check_apt

### DISK ###
command[check_disk]=/usr/local/nagios/libexec/check_disk $ARG1$
command[check_ide_smart]=/usr/local/nagios/libexec/check_ide_smart $ARG1$

### PROCESSES ###
command[check_all_procs]=/usr/local/nagios/libexec/custom_check_procs
command[check_procs]=/usr/local/nagios/libexec/check_procs $ARG1$

### OPEN FILES ###
command[check_open_files]=/usr/local/nagios/libexec/check_open_files.pl $ARG1$

### NETWORK CONNECTIONS ###
command[check_netstat]=/usr/local/nagios/libexec/check_netstat.pl -p $ARG1$ $ARG
2$

Re: How Does NRPE Calculate Memory

Posted: Wed May 08, 2019 11:27 am
by scottwilkerson
Can you also share the configuration for this service in XI?

Re: How Does NRPE Calculate Memory

Posted: Fri May 17, 2019 8:10 am
by mkeey
Sorry for the delay in responding. Can you share with me how to export the config?

Re: How Does NRPE Calculate Memory

Posted: Fri May 17, 2019 8:16 am
by scottwilkerson
mkeey wrote:Sorry for the delay in responding. Can you share with me how to export the config?
Configure -> CCM -> Services
Click on the "View Config" icon next to this service.

then find the definition for this service name

Re: How Does NRPE Calculate Memory

Posted: Fri May 17, 2019 9:34 am
by mkeey
Sorry, didn't realize you just wanted a copy of the config file. Changed hostname & ip along with notified users for proprietary reasons.


###############################################################################
#
# Services configuration file
#
# Created by: Nagios CCM 2.7.0
# Date: 2019-05-17 10:31:15
# Version: Nagios Core 4.x
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
host_name REMOTESERVERNAME
service_description / Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 15% -c 5% -p /'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts ENDUSERS
_xiwizard linux-server
register 1
}

define service {
host_name REMOTESERVERNAME
service_description /home Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 15% -c 5% -p /home'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts ENDUSERS
_xiwizard linux-server
register 1
}

define service {
host_name REMOTESERVERNAME
service_description /opt Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 15% -c 5% -p /opt'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts ENDUSERS
_xiwizard linux-server
register 1
}

define service {
host_name REMOTESERVERNAME
service_description /srv/bit9 Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 15% -c 5% -p /srv/bit9'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts ENDUSERS
_xiwizard linux-server
register 1
}

define service {
host_name REMOTESERVERNAME
service_description /tmp Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 15% -c 5% -p /tmp'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts ENDUSERS
_xiwizard linux-server
register 1
}

define service {
host_name REMOTESERVERNAME
service_description /var Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 15% -c 5% -p /var'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts ENDUSERS
_xiwizard linux-server
register 1
}

define service {
host_name REMOTESERVERNAME
service_description /var/log Disk Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_disk!-a '-w 15% -c 5% -p /var/log'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts ENDUSERS
_xiwizard linux-server
register 1
}

define service {
host_name REMOTESERVERNAME
service_description CPU Stats
use xiwizard_nrpe_service
check_command check_nrpe!check_cpu_stats!-a '-w 90 -c 95'
max_check_attempts 20
check_interval 5
retry_interval 3
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options n
notifications_enabled 0
contacts ENDUSERS
_xiwizard linux-server
register 1
}

define service {
host_name REMOTESERVERNAME
service_description Memory Usage
use xiwizard_nrpe_service
check_command check_nrpe!check_mem!-a '-w 10 -c 5'
max_check_attempts 24
check_interval 10
retry_interval 5
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options n
notifications_enabled 0
contacts ENDUSERS
_xiwizard linux-server
register 1
}

define service {
host_name REMOTESERVERNAME
service_description Ping
use xiwizard_linuxserver_ping_service
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
contacts ENDUSERS
_xiwizard linux-server
register 1
}

define service {
host_name REMOTESERVERNAME
service_description Users
use xiwizard_nrpe_service
check_command check_nrpe!check_users!-a '-w 10 -c 20'
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 0
notification_period xi_timeperiod_24x7
notifications_enabled 1
contacts ENDUSERS
_xiwizard linux-server
register 1
}

###############################################################################
#
# Services configuration file
#
# END OF FILE
#
###############################################################################

Re: How Does NRPE Calculate Memory

Posted: Fri May 17, 2019 9:49 am
by scottwilkerson
this all looks correct.

I'm looking at your first post and what do you not think is correct?

The server has 43082744 bytes memory, which is 42072 MB

Code: Select all

43082744 / 1024 = 42072.9921875

Re: How Does NRPE Calculate Memory

Posted: Fri May 17, 2019 2:13 pm
by mkeey
Thanks Scott... I will forward to my Linux Admin who was questioning this. I will get back to you.

Re: How Does NRPE Calculate Memory

Posted: Fri May 17, 2019 2:49 pm
by scottwilkerson
mkeey wrote:Thanks Scott... I will forward to my Linux Admin who was questioning this. I will get back to you.
Sounds good