# monitrc - Monit control file
# 
# Copyright (C) 2007 FON Technology

# Global section
# --------------
set daemon 30
set logfile /var/log/monit.log
set httpd port 2812 and
	use address localhost
	allow localhost

# Services section
# ----------------

# dnsmasq: dns connection-test
check process dnsmasq with pidfile /var/run/dnsmasq.pid
	start program = "/etc/init.d/dnsmasq start"
	stop program  = "/etc/init.d/dnsmasq stop"
	mode manual
	if failed port 53 type udp protocol dns
	then alert

# chillispot: send/expect connection test
check process chillispot with pidfile /var/run/chilli.pid
	start program = "/etc/rc1.d/S40chillispot start"
	stop program  = "/etc/rc1.d/S40chillispot stop"
	mode manual
	if failed host 192.168.182.1 port 3990 
		send "GET /  HTTP/1.1\r\nHost: foo.bar.baz\r\n\r\n"
		expect "HTTP/1.0 302 Moved Temporarily"
	then restart
	if 5 restarts within 5 cycles
	then alert
#
# Includes section
#

#  include /etc/monit.d/*
