After trying all of the different options included with the check_proc plugin and not getting anywhere I decided to go a different route. I created the following python script and included it in the plugins directory. The python script name is check_service.py. If you name it something else you will have to modify the services and commands below accordingly.
import os
status = os.system('systemctl is-active --quiet nginx')
if status == 768:
print('Critical, Service is not running')
exit(2)
elif status == 0:
print('OK, Service is Running')
exit(0)
I then added the following command to the commands.cfg file. The $ARG1$ is there for a future version of the script I am working on. It is not required.
define command{
command_name check_service
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_service $ARG1$
}
Defined the service like this
define service {
use local-service
host_name debian
service_description Load Balance Service
check_command check_service
}
Then on the client I added this command to the nrpe.cfg file
command[check_service]=python3 /usr/lib/nagios/plugins/check_service.py
Hope this helps someone somewhere down the road.