MONITORD(8)

NAME
monitord - monitor system services for accidental termination

SYNOPSIS
monitord [-t interval]

DESCRIPTION
monitord is a simple to use system service that allows one to easily monitor other system services for accidental termination. If they terminate because of some internal bug or illegitimate action, such as a DoS attack, they are restarted with the given username, group, and parameters specified in /usr/local/etc/monitord.conf.

The sole option is as follows:

-t interval
    The time interval at which to check the system processes, which are configured in /usr/local/etc/monitord.conf. The default interval is 10 seconds. The interval is specified in seconds.

The configuratiion file for monitord, /usr/local/etc/monitord.conf, has a simple format. It is divided into two parts. The first part contains general configuration informaion, which for now consists simply of the admin's email.The second part consists of multiple configuration lines for each service to be monitored. In this second part, the first and second columns contain the user and group, respectively, under which the given service on that line will be run as if it needs to be restarted. The third column consists of the options to be used in monitoring that particular service. Currently, three options are supported:

auto
    Indicates that the service should be automatically restarted if it's found down. This is also the default behaviour when neither auto nor noauto are specified.

noauto
    Indicates that the service should not be automatically restarted if it's down.

alert
    Indicates that if this service is found down, the administrator is automaticallynotified via email, as specified in the first part of the configuration file. Also, once a service is restarted, this option will prompt monitord to notify the administrator that it was successfully restarted.

The fourth column is the service that is being monitored, with its full path, and the last column, which is optional, may contain any parameters that should be passed to the service. For instance, the following line would configure monitord to watch for sendmail(8) and restart it, in case of termination, with the user root and group wheel and then notify the administrator.

root wheel auto,alert /usr/sbin/sendmail -bd -q30m

EXAMPLES
Here are a few example service entries:

    root     wheel     auto,alert	/usr/sbin/inetd        -wW
    root     wheel     auto,alert	/usr/sbin/syslogd
    root     wheel     auto,alert	/usr/local/sbin/sshd
    www      www       auto,alert	/usr/local/sbin/httpd
    usenet   usenet    auto,alert	/usr/local/sbin/nntpd

IMPLEMENTATION NOTES
This is version 0.2.0.

When using a time interval that is smaller than 5 seconds, one must note that an increasingly larger amount of CPU time will be used by the process. It is recommended that one keep the interval equal to or above 5 seconds.

Also, this implementation of monitord isn't as efficient memory-wise as it could be. Subsequent versions will make full use of dynamic memory management.

FILES

/usr/local/etc/monitord.conf
    configuration file

DIAGNOSTICS
When restarting a service which it is monitoring, monitord will notify syslogd(8) of the event.

monitord should be run as root so that it can restart the services it is monitoring with the correct username and group.

AUTHOR
This manual page was written by W. M. Shandruk <walt@erudition.net>.

BUGS
There are no known bugs.