#!/bin/bash

PORT=5044                   # PORT

ss -tln | grep ${PORT} >/dev/null 2>&1
rc=$?

if [[ $rc -eq 0 ]]; then
	logger -t "Process check" "httpd is running"
	exit 0
else	
	logger -t "Process check" "httpd is down"
	nohup /opt/logstash/bin/logstash -f /etc/logstash/conf.d/nginx_json.conf -r &
fi