File: //usr/lib/python2.7/site-packages/lap/filaemkt.py
import urllib
import sys
def __run__(params):
try:
url = params.get('url', 'http://localhost/monitor/monitoracao_fila.php')
except Exception, e:
return [2, "CRITICAL - Error: %s" % repr(e)]
try:
action = urllib.urlopen(url)
response = action.read()
except Exception, e:
return [2, "CRITICAL - Error: %s" % repr(e)]
if response == '|retorno:OK||':
return [0, "OK - messagens are being sent"]
else:
return [2, "CRITICAL - Error: messages are NOT being sent"]