I've two custom scripts that doesn't work with NRPE (many others works)
The commands (I tried in two diferents servers):
Code: Select all
echo "$(/usr/local/nagios/libexec/./check_jmx -U service:jmx:rmi:///jndi/rmi://$url:$port/jmxrmi -O java.lang:type=Memory -A HeapMemoryUsage -K used -u B -w $warning_level -c $critical_level | cut -d= -f2)"
echo "$(dd if=/dev/zero of=/tmp/output.img bs=4k count=512k conv=fdatasync 2>&1 | awk '/bytes/{print $(NF-1), $NF}' | cut -d' ' -f1; rm -rf /tmp/output.img )"
In remote machine:
Code: Select all
./check_jmx.sh
JMX OK HeapMemoryUsage.used=1530968840
Code: Select all
su nrpe -c './check_jmx.sh' -s /bin/bash
JMX OK HeapMemoryUsage.used=1387879800
Code: Select all
/usr/lib/nagios/plugins/check_nrpe -H myserver.com -c 'check_jmx'
CHECK_NRPE: No output returned from daemon.
regards.