freebsd-ports/sysutils/monit/files/monit.sh
Kirill Ponomarev aa06cae11d Add monit 4.4, UNIX system management and monitoring tool.
Monit is a utility for managing and monitoring processes,
 files, directories, devices and network services on a Unix system.
 Monit conducts automatic maintenance and repair and can execute
 meaningful causal actions in error situations.

 monit supports:
  * Daemon mode - poll services at a specified interval
  * Group and manage groups of services, service dependencies
  * Logging - syslog or own logfile
  * Alert, start, stop and restart of services based on it's
  * characteristics
  * MD5 and SHA1 checksums
  * Runtime Unix socket and TCP/IP port checking (tcp and udp)
  * Process status, timeout, memory and cpu usage, etc.
  * Device usage monitoring (inodes and space)
  * File monitoring (timestamp, checksum, permission, owner, etc.)
  * Directory monitoring (timestamp, permission, owner, etc.)
  * Remote network services monitoring (ping, response time,
  * protocol, etc.)
  * System load average monitoring
  * Flexible and customizable email alert messages and notifications
  * Protocol verification such as HTTP, FTP, SMTP, POP, IMAP, NNTP,
  * etc.
  * A HTTP interface with XML output option

PR:		ports/75811
Submitted by:	Martin Pala <martinp at tildeslash.com>
2005-02-18 19:14:12 +00:00

47 lines
909 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: monit
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable monit:
# monit_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable monit
#
. %%RC_SUBR%%
name="monit"
rcvar=`set_rcvar`
restart_precmd="monit_checkconfig"
reload_precmd="monit_checkconfig"
stop_cmd="monit_stop"
default_config=%%PREFIX%%/etc/monitrc
required_files=${default_config}
command="%%PREFIX%%/bin/monit"
command_args="-c ${default_config}"
pidfile="/var/run/monit.pid"
[ -z "$monit_enable" ] && monit_enable="NO"
load_rc_config $name
monit_checkconfig()
{
echo "Performing sanity check on monit configuration:"
${command} ${command_args} -t
}
monit_stop() {
${command} ${command_args} quit
run_rc_command poll
}
extra_commands="reload"
run_rc_command "$1"