As a user or administrator working on Linux or Unix system can check whether services are running or not using ps command, simple shell script to check your services. Create a shell file check_services.sh add all the line to that file, give execute permission,

# vim check_services.sh

# chmod +x check_services.sh

check_services.sh

#!/bin/sh
### Enter your Service Name.
SERVICE_NAME=named
if (( $(ps -ef | grep -v grep | grep $SERVICE_NAME | wc -l) > 0 ))
then
echo "$SERVICE_NAME is Running!"
else
echo "CRITICAL $SERVICE_NAME is not running"
fi

Also, help the below single line command,
 
# pgrep httpd || echo "not running!!!"
1619
84060
84862
# pgrep httpd && echo "Service is running!!!"

or
 
# pidof httpd && echo "test"