#!/bin/sh

if [ "$(/usr/bin/pgrep -u nagios -f ' /usr/local/monitoring/nagios/libexec/check_streampulse ' | wc -l)" -gt 18 ]; then
	echo "OK: Check rescheduled. Too many stream pulse checks running"
	exit 0
fi

/usr/local/monitoring/nagios/libexec/check_streampulse -h "$1" -p "$2" -testurl "$3" -testtime "$4" -fcsubscribe "$5"
exit $?
