custom_check_mem reports incorrect data & status to NagiosXI
Posted: Tue Jul 30, 2019 1:05 am
Hello there,
NagiosXI - v5.6.2
Nagios Core - v4.4.3
I noticed a weird behavior when monitoring Memory for an RHEL 7.x host from NagiosXI server through NRPE and default check_mem command (available from /usr/local/nagios/etc/nrpe/common.cfg).
When I run the script locally on the host it reports data correctly as shown below:
[root@xxxxx ~]# grep check_mem /usr/local/nagios/etc/nrpe/common.cfg
command[check_linux_mem]=/usr/local/nagios/libexec/custom_check_mem $ARG1$
[root@xxxxx ~]#
[root@xxxxx ~]# /usr/local/nagios/libexec/custom_check_mem -w 20 -c 10 -n
OK - 11432 / 15836 MB (72%) Free Memory, Used: 3873 MB, Shared: 88 MB, Buffers + Cached: 11678 MB | total=15836MB free=11432MB used=3873MB shared=88MB buffers_and_cached=11678MB
[root@xxxxx ~]#
But when I call this command from NagiosXI server, it reports critical status for memory and does not include percentage value, as shown below:
[root@yyyyy ~]#
[root@yyyyy ~]# /usr/local/nagios/libexec/check_nrpe -H pnzul010.ad.infosys.com
NRPE v3.2.1
[root@yyyyy ~]#
[root@yyyyy ~]# /usr/local/nagios/libexec/check_nrpe -H xxxxx -c check_linux_mem -a '-w 20 -c 10 -n'
CRITICAL - 11432 / 15836 MB (%) Free Memory, Used: 3874 MB, Shared: 88 MB, Buffers + Cached: 11678 MB | total=15836MB free=11432MB used=3874MB shared=88MB buffers_and_cached=11678MB
[root@yyyyy ~]#
This is further leading to incorrect status of Memory utilization and further generating alerts to the admins.
Can anyone please help here? Anyone faced similar issue earlier?
NagiosXI - v5.6.2
Nagios Core - v4.4.3
I noticed a weird behavior when monitoring Memory for an RHEL 7.x host from NagiosXI server through NRPE and default check_mem command (available from /usr/local/nagios/etc/nrpe/common.cfg).
When I run the script locally on the host it reports data correctly as shown below:
[root@xxxxx ~]# grep check_mem /usr/local/nagios/etc/nrpe/common.cfg
command[check_linux_mem]=/usr/local/nagios/libexec/custom_check_mem $ARG1$
[root@xxxxx ~]#
[root@xxxxx ~]# /usr/local/nagios/libexec/custom_check_mem -w 20 -c 10 -n
OK - 11432 / 15836 MB (72%) Free Memory, Used: 3873 MB, Shared: 88 MB, Buffers + Cached: 11678 MB | total=15836MB free=11432MB used=3873MB shared=88MB buffers_and_cached=11678MB
[root@xxxxx ~]#
But when I call this command from NagiosXI server, it reports critical status for memory and does not include percentage value, as shown below:
[root@yyyyy ~]#
[root@yyyyy ~]# /usr/local/nagios/libexec/check_nrpe -H pnzul010.ad.infosys.com
NRPE v3.2.1
[root@yyyyy ~]#
[root@yyyyy ~]# /usr/local/nagios/libexec/check_nrpe -H xxxxx -c check_linux_mem -a '-w 20 -c 10 -n'
CRITICAL - 11432 / 15836 MB (%) Free Memory, Used: 3874 MB, Shared: 88 MB, Buffers + Cached: 11678 MB | total=15836MB free=11432MB used=3874MB shared=88MB buffers_and_cached=11678MB
[root@yyyyy ~]#
This is further leading to incorrect status of Memory utilization and further generating alerts to the admins.
Can anyone please help here? Anyone faced similar issue earlier?