Page 1 of 1

check_disk shows different alarm from remote and local

Posted: Thu Mar 14, 2019 1:58 am
by tfc
Hi,
I have Nagios server 4.4.3 and nrpe 3.2.1on client side.
My problem is , Command Output shows OK but notification shows CRITICAL.
When I run check_nrpe from Nagios server:
./check_nrpe -H 10.40.1.225 -p 5249 -c check_sdb1
DISK OK - free space: / 37932 MB (74.12% inode=100%); /home 48527 MB (99.93% inode=100%); /boot 229 MB (46.19% inode=100%);| /=13242MB;40940;46057;0;51175 /home=32MB;38848;43704;0;48560 /boot=267MB;396;446;0;496
when I run check_disk in client side:
DISK OK - free space: / 37932 MB (74,12% inode=100%); /home 48527 MB (99,93% inode=100%); /boot 229 MB (46,19% inode=100%);| /=13242MB;40940;46057;0;51175 /home=32MB;38848;43704;0;48560 /boot=267MB;396;446;0;496
But notification mail is like:
Service: Disk2 Utilization
Host: XXXXX
Address: 10.40.1.225
State: CRITICAL
Date/Time: Thu Mar 14 05:29:13 +03 2019
Additional Info:
DISK CRITICAL - free space: /var/spool/imap/domain/y 0 MB (0.00% inode=-9900%
):

Server side onfiguration is:
define service{
use XXXX-service
hostgroup_name XXXXX-servers
service_description Disk2 Utilization
check_command check_nrpe_disk_sdb
}

define command{
command_name check_nrpe_disk_sdb
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5249 -c check_sdb1
}
Client side configuration is:
command[check_sdb1]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -x /dev/sdb1
And disk output in server:
[
root@XXXXX plugins]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 50G 13G 38G 26% /
devtmpfs 2,9G 0 2,9G 0% /dev
tmpfs 2,9G 20K 2,9G 1% /dev/shm
tmpfs 2,9G 116M 2,8G 4% /run
tmpfs 2,9G 0 2,9G 0% /sys/fs/cgroup
/dev/sdb1 300G 158G 142G 53% /var/spool/imap/domain/y
/dev/mapper/centos-home 48G 33M 48G 1% /home
/dev/sda1 497M 268M 230M 54% /boot
tmpfs 579M 0 579M 0% /run/user/

Re: check_disk shows different alarm from remote and local

Posted: Thu Mar 14, 2019 4:26 pm
by npolovenko
Hello, @tfc. Looks like you're assigning this check to a host group meaning every host in that group will be using a service with this nrpe command. Are you sure that you were looking at the right host in the gui and not any other host from that hostgorup?

Re: check_disk shows different alarm from remote and local

Posted: Fri Mar 15, 2019 12:17 am
by tfc
Hi,
I am sure. because there is only on host in that hostgroup. But main problem is ;
I check same host and same disk. But server said criticical:
[root@aggmonprod libexec]# ./check_nrpe -p 5249 -H 10.40.1.225 -c check_sdb1
DISK CRITICAL - free space: /dev/sdb1 0 GB (0.00% inode=-9900%);| /dev/sdb1=7003161940GB;5603473209;6303907360;0;7004341512
Regards,
client nrpe.cfg :
command[check_sdb1]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -u GB -M -p /dev/sdb1
But Client said Normal:
[root@epostadc1 local]# /usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -u GB -M -p /dev/sdb1
DISK OK - free space: /dev/sdb1 143 GB (47,79% inode=100%);| /dev/sdb1=156GB;239;269;0;299
Why different?

Re: check_disk shows different alarm from remote and local

Posted: Fri Mar 15, 2019 12:14 pm
by npolovenko
@tfc, That's odd. Can you log in to the NRPE servers terminal and run these commands?
/usr/local/nagios/libexec/check_nrpe -p 5249 -H 127.0.0.1 -c check_sdb1
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_sdb1

Re: check_disk shows different alarm from remote and local

Posted: Mon Mar 18, 2019 12:11 am
by tfc
Hi,
There is no sdb1 disk on server side.
[root@aggmonprod libexec]# pwd
/usr/local/nagios/libexec
[root@aggmonprod libexec]# ./check_nrpe -p 5249 -H 127.0.0.1 -c check_sdb1
connect to address 127.0.0.1 port 5249: Connection refused
connect to host 127.0.0.1 port 5249: Connection refused
[root@aggmonprod libexec]# ./check_nrpe -H 127.0.0.1 -c check_sdb1
NRPE: Command 'check_sdb1' not defined

Re: check_disk shows different alarm from remote and local

Posted: Mon Mar 18, 2019 4:22 pm
by npolovenko
@tfc
There is no sdb1 disk on server side.
On the nrpe client side? Did you run this command on the XI server or on the remote NRPE server? We need to see the output of this command on the remote nrpe server. You need to ssh into nrpe server and run these commands:
/usr/local/nagios/libexec/check_nrpe -p 5249 -H 127.0.0.1 -c check_sdb1

/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 -c check_sdb1