
# database testing
Group "Databases" {

	Service DB {
		# dsn  - the db to connect to, using DBI syntax
		# user - the username
		# pass - the password
		# sql  - a select statement
		dsn:		dbi:Pg:dbname=mydatabase;host=dbhost
		user:		argus
		pass:		password
		sql:		select COUNT(*) from mytable
		minvalue:	10
	}
}

# graphing demo
Group "Bandwidth" {
	# verify usage is <20Mbps, and graph usage
	graph: yes
	ylabel: bits per second
	title:  Bandwidth
	Group "Sprint T3" {
		service UDP/SNMP {
			label:		Out
			calc:		ave-rate-bits
			hostname:       gw-amb3.example.com
			oid:		.1.3.6.1.2.1.2.2.1.16.1
			maxvalue:	20000000
		}
		service UDP/SNMP {
			label:		In
			calc:		ave-rate-bits
			hostname:       gw-amb3.example.com
			oid:		.1.3.6.1.2.1.2.2.1.10.1
			maxvalue:	20000000
		}
	}
}

# extended DNS testing
Group "DNS" {
	Host "ns1.example.com" {
		# is DNS running?
		Service DNS			# same as UDP/DNS in 3.1

		# are we authoritative?
		Service Domain/example.com	# same as UDP/Domain in 3.1

		Service DNS/Serial/example.com {
			# make sure serial number is at least this tall
			minvalue:	2001110100
		}

		Service DNS/A/www.example.com {
			# make sure the web server is where is should be
			expect:		10.1.2.3
		}

		# fully specified in "long form"
		# make sure we have 2 MX servers
		Service DNS {
			zone:	example.com
			class:	IN
			query:	MX
			test:	nanswers
			expect: 2
		}
	}
}

# advanced generic test functions
Group "NTP" {
	Host "ntp.example.com" {

		# pull out the stratum, and make sure is at most '6'
		Service UDP/NTP {
			label:    Stratum
			uname:    NTP-Stratum
			unpack:	  xC
			maxvalue: 6
		}

		# pull out the root-dispersion
		# verify that our clock has not drifted too far
		# and graph the result
		Service UDP/NTP {
			graph:	  yes
			title:	  Root Dispersion
			ylabel:	  seconds
			label:	  Dispersion
			uname:	  NTP-Disp
			unpack:	  x8N
			scale:	  65536
			maxvalue: 2
		}
	}
}


# my own stats
Group "My Stats" {
	graph:	yes

	# number of notifications
	Service Self/Notifs

	Service Self/idle {
		title:	Percent Idle
		calc:	ave-rate
		scale:	0.01
		# let someone know when it is time to upgrade h/w
		minvalue:  20
		messagedn: time to buy faster server
	}

	Service Self/tested {
		title:	Monitor Rate
		ylabel: tests per second
		calc:	ave-rate
	}

	Service Prog {
		# your ps may be different
		command:	ps -p $ARGUS_PID -o vsz | tail -1
		uname:		VSZ
		title:		Memory Use
		ylabel:		kBytes
	}
}

