From the Nagios XI server i just get back:
Code: Select all
# ./check_nrpe -H lnx-ethosapi2-test -u -t 30 -c tomcat_heap
UNKNOWN Can't connect to the JVM:
Code: Select all
command[tomcat_heap]=/usr/bin/sudo -u tomcat8 /usr/lib64/nagios/plugins/check_jvm -n org.apache.catalina.startup.Bootstrap -p heap -w 90 -c 101
Code: Select all
# su - nrpe
Last login: Wed Jul 1 16:20:17 CDT 2020 on pts/0
$ /usr/bin/sudo -u tomcat8 /usr/lib64/nagios/plugins/check_jvm -n org.apache.catalina.startup.Bootstrap -p heap -w 90 -c 101
OK 10% | max=6174015488;;; commited=6174015488;;; used=676489776;;;
Code: Select all
Defaults:nrpe !requiretty
nrpe ALL=(ALL) NOPASSWD: ALL
The SELinux boolean "nagios_run_sudo" is on. But just to make sure that SELinux is not causing problems, i have temporararily turned it off:
Code: Select all
# sestatus
SELinux status: disabled
Code: Select all
# systemctl status nrpe -l
Jul 02 10:51:54 lnx-ethosapi2-test.test.drake.edu nrpe[1436]: Host 10.10.3.0 is asking for command 'tomcat_heap' to be run...
Jul 02 10:51:54 lnx-ethosapi2-test.test.drake.edu nrpe[1436]: Running command: /usr/bin/sudo -u tomcat8 /usr/lib64/nagios/plugins/check_jvm -n org.apache.catalina.startup.Bootstrap -p heap -w 90 -c 101
Jul 02 10:51:54 lnx-ethosapi2-test.test.drake.edu nrpe[1437]: WARNING: my_system() seteuid(0): Operation not permitted
Jul 02 10:51:54 lnx-ethosapi2-test.test.drake.edu sudo[1438]: nrpe : TTY=unknown ; PWD=/ ; USER=tomcat8 ; COMMAND=/usr/lib64/nagios/plugins/check_jvm -n org.apache.catalina.startup.Bootstrap -p heap -w 90 -c 101
Jul 02 10:51:54 lnx-ethosapi2-test.test.drake.edu nrpe[1436]: Command completed with return code 3 and output: UNKNOWN Can't connect to the JVM:
Jul 02 10:51:54 lnx-ethosapi2-test.test.drake.edu nrpe[1436]: Return Code: 3, Output: UNKNOWN Can't connect to the JVM: