The first (and basically only issue) was that I couldn't find and good NRPE plugins to use to perform the monitoring with. The standard check_procs plugin couldn't be used as I did not find any ways to distinguish between the different OC4J processes using this plugin. Well, this wasn't a big issue as you basically can use any given script as a NRPE plugin. So, I quickly created a script that would allow me to count the # of processes for the different OC4J containers, not the prettiest solution, but it does the job.
Here is the script:
#!/bin/bashOnce the script was in place I could continue to configure op5 to use these lines for the monitoring:
OK_PROCESSES="4"
PROC_NAME="BEEAPP"
while getopts "o:N:" optionName; do
case "${optionName}" in
"o") OK_PROCESSES="${OPTARG}";;
"N") PROC_NAME="${OPTARG}";;
esac
done
CURRENT_PROCESSES=`ps -ef | grep ${PROC_NAME} | grep -v bash | grep -v grep | wc -l`
if [[ ${CURRENT_PROCESSES} -eq ${OK_PROCESSES} ]]; then
echo "${PROC_NAME} OK: ${CURRENT_PROCESSES} processes"
exit 0
else
echo "${PROC_NAME} ERROR: incorrect number of processes: ${CURRENT_PROCESSES}"
exit 2
fi
command[bee_core]=/opt/plugins/check_beehive -o 2 -N BEECORE
command[bee_mgmt]=/opt/plugins/check_beehive -o 1 -N BEEMGMT
command[bee_app]=/opt/plugins/check_beehive -o 4 -N BEEAPP
command[bee_client]=/opt/plugins/check_beehive -o 4 -N BEECLIENT
command[bee_soa]=/opt/plugins/check_beehive -o 1 -N oc4j_soa
And finally I just had to add these commands as services in op5 (as check_nrpe services) and the monitoring was up & running.