we have a nagios monitoring system already running and I was after monitor our vmware datastores using the following plugin I installed vmware cli and tested with no issues:
[root@nrpe-relay ~]# /usr/lib64/nagios/plugins/check_vmfs.sh -C /usr/lib64/nagios/plugins/vmware_esxi_conf.txt -S 192.168.20.241 -V /vmfs/volumes/LocalSlot45S6 -w 75 -c 90 -u Gb
WARNING - /vmfs/volumes/LocalSlot45S6 - total: 931.25 Gb - used: 800.95 Gb (86%)- free: 130.29 Gb (14%) | /vmfs/volumes/LocalSlot45S6=800.95Gb;698.43;838.12;;931.25
[root@nrpe-relay ~]# ps auxww|grep nrpe
nagios 1463 0.0 0.1 41468 1364 ? Ss 21:24 0:00 nrpe -c /etc/nagios/nrpe.cfg -d
root 2261 0.0 0.0 103304 876 pts/0 S+ 22:00 0:00 grep nrpe
However I am not getting same value when the command runs remotely:
[root@nagios nagios]# /usr/lib64/nagios/plugins/check_nrpe -H <hostname> -c 'check_datastore_LocalSlot45S6'
CRITICAL -
This is what I have in my cfg file
command[check_datastore_LocalSlot45S6]=/usr/lib64/nagios/plugins/check_vmfs.sh -C /usr/lib64/nagios/plugins/vmware_esxi_conf.txt -S 192.168.20.241 -V /vmfs/volumes/LocalSlot45S6 -w 75 -c 90 -u Gb
and my server cfg:
define service{
use generic-service
host_name <hostname>
service_description datastore-LocalSlot45S6
check_command check_nrpe!check_datastore_LocalSlot45S6
}
This is what I can see from /var/log/message:
nagios nagios: EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;<hostname>;datastore-LocalSlot1-2S3;1441798845
QUESTION: Anyone has any clue about where the problem is? or how can I trace down this issue?
nrpe
as on the remote host? You show that you can run thecheck_vmfs.sh
on the remote host as root, but it is not likely that the NRPE daemon is running as root. Paste the output ofps auxww|grep nrpe
on the remote host into your answer.nagios
. What happens when you try to runcheck_vmfs.sh
as the nagios user on nrpe-relay?/bin/su - nagios -s /bin/bash
, then run the full command from the shell.