#!/bin/bash

mcrcon_path=""
mcrcon_host=""
mcrcon_port="25575"
mcrcon_password=""

TPS=`$mcrcon_path -c -H $mcrcon_host -P $mcrcon_port -p $mcrcon_password serverstate | grep TPS | awk '{ print $2 }'`
TPS=`echo $TPS | awk 'sub("..$", "")'`
if [ $TPS -ge 20 ]
then
	echo "OK - Ticks per Second: $TPS | tps=$TPS;;;0;20"
	exit 0
else
	echo "Critical - Ticks per Second: $TPS | tps=$TPS;;;0;20"
	exit 2
fi
