check process apcupsd with pidfile /var/run/apcupsd.pid
	group ups
	group apcupsd
	start program = "/sbin/service apcupsd start"
	stop  program = "/sbin/service apcupsd stop"
	if 5 restarts within 5 cycles then timeout
	if failed host localhost port 3551 type TCP then restart
	depends on apcupsd_bin
	depends on apcupsd_rc

# FIXME: https://bugzilla.altlinux.org/show_bug.cgi?id=20338
check file apcupsd_bin with path /usr/sbin/apcupsd
	group apcupsd
	if failed checksum then unmonitor
	if failed permission 700 then unmonitor
	if failed uid root then unmonitor
	if failed gid root then unmonitor

check file apcupsd_rc with path /etc/init.d/apcupsd
	group apcupsd
	include /etc/monitrc.d/templates/rootbin
