以下に、記述。
#!/bin/bash
ssh -o ConnectTimeout=2 linux_user@your_server ps -lef | grep ' apache ' | grep '/usr/sbin/httpd' > /tmp/check_apache_run.txt
if [ -s /tmp/check_apache_run.txt ]; then
echo "FILE SIZE != 0"
echo "Yourサーバー(Apache) ok" >> /tmp/check_apache_run_report.txt
else
echo "FILE SIZE = 0"
echo "Yourサーバー(Apache) 【停止】状態" >> /tmp/check_apache_run_report.txt
fi