Monit - Processes and Applications Monitoring

Monit is a free open source utility for managing and monitoring; networks, processes, programs, files, directories and filesystems on a UNIX system. Monit can conduct automatic maintenance and repair and can execute meaningful causal actions in error situations.

Note: AstLinux 1.2.2 or later is required

Monit Configuration

The AstLinux Web Interface is used for configuration, click on Configure Monit

Network tab → Network Services:
Configure Monit

Enable by clicking on “Configure Monit” and enable “Monitoring”, additionally you will have a few options:

Server Config

Tip → If your Monit config includes a “check network” for a 1 GB interface, it is suggested to set the “Check Interval” to 30 seconds.

Notifications Config

The “To” address entry may include multiple space separated email addresses. Monit doesn't work with msmtp-aliases!
But you can define multiple alert user@example.com entries in the Monit config (one line per entry).

The configuration is autogenerated. You just need to enable Monitoring and enter the Monit notification email address.

Once Monit has been enabled and restarted, the Monit services may be customized by using the Edit tab…

Edit Monit Services

Or use the CLI and edit the file: /mnt/kd/monit/monit.d/services.conf

Note that all filenames matching /mnt/kd/monit/monit.d/*.conf will be included in the configuration.

Apply changes by restarting Monit.

Tip → From the CLI, a handy command to check the syntax of your monitrc file and all included monit.d/*.conf files…

monit -t

should respond with something like: Control file syntax OK

If you need a more specialized base configuration, copy /etc/monit/monitrc to /mnt/kd/monit/monitrc, edit it and restart Monit.

Monit Web Interface

By default the Monit tab is not shown, enable it via the Prefs tab…
Show Monit Tab

The “Monit Service Manager” may be explored by using the Monit tab:
Monit Tab

Tip → If you prefer to view the “Monit Service Manager” in a separate browser window, ex. for host “pbx” use URL:

https://pbx/admin/monit/

Documentation

The documentation can be found at:

http://mmonit.com/monit/documentation/monit.html

http://mmonit.com/wiki/

Most recent sample monitrc configuration file:

https://bitbucket.org/tildeslash/monit/raw/HEAD/monitrc

Monit Debug

If you need to debug Monit for some reason:

service monit stop
monit -c /etc/monit/monitrc -vv -I 2>&1 | tee /mnt/kd/monit_debug.log