|NOTE: Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and Mac OS X) or by clicking the shortcut in the Start Menu under "Start -> Bitnami APPNAME Stack -> Application console" (Windows). Learn more.|
Monit is a free open source utility for managing and monitoring, processes, programs, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.
How to check Monit configuration?
Check server status with the following command:
$ sudo monit status
At this point you should see the servers that Monit is monitoring and the machine statistics:
The Monit daemon 5.5.1 uptime: 1d 19h 35m Process 'mysql' status Running monitoring status Monitored pid 27154 parent pid 26893 uptime 1m children 0 memory kilobytes 38428 memory kilobytes total 38428 memory percent 0.2% memory percent total 0.2% cpu percent 0.0% cpu percent total 0.0% data collected Thu, 15 Aug 2013 13:39:06 Process 'apache' status Running monitoring status Monitored pid 27205 parent pid 1 uptime 1m children 8 memory kilobytes 13500 memory kilobytes total 86504 memory percent 0.0% memory percent total 0.5% cpu percent 0.0% cpu percent total 0.0% data collected Thu, 15 Aug 2013 13:39:06 System 'desktop' status Running monitoring status Monitored load average [0.14] [0.21] [0.22] cpu 0.9%us 0.7%sy 0.0%wa memory usage 7113496 kB [43.5%] swap usage 182008 kB [1.1%] data collected Thu, 15 Aug 2013 13:39:06
Monit also includes a small Web application to manage the servers. It only works from localhost by default but you can add other IP addresses in the installdir/config/monit/bitnami.conf configuration file:
# Bitnami configuration file for Monit. set httpd port 2812 and use address localhost allow localhost include installdir/config/monit/conf.d/*.conf
The Monit Server Manager can be accessed at http://localhost:2812 and looks like this:
How to configure my server with Monit?
You can find all Monit configuration files for the Bitnami servers in the installdir/config/monit/conf.d folder. For example, the Apache Monit config file looks like this:
check process apache with pidfile "installdir/apache2/logs/httpd.pid" start program = "installdir/apache2/scripts/ctl.sh start" with timeout 90 seconds stop program = "installdir/apache2/scripts/ctl.sh stop"
As you can see in the above example, it is only necessary to specify the PID file location and the commands to start/stop the server. You can find more configuration options at the Monit documentation.
Once you create your own config file for your server, add it to the same folder. To reinitialize Monit, run the following command:
$ sudo monit reload
How to disable Monit?
To disable a server, run the following command to disable it. For example, to disable the Apache server:
$ sudo monit unmonitor apache
You can also stop the Monit process with the following command:
$ sudo monit quit
How to enable Monit?
Recent versions of Bitnami stacks ship Monit configuration files for all servers. Enable Monit by installing it and creating a symbolic link.
Follow these steps:
$ sudo apt-get install monit $ sudo ln -s installdir/config/monit/bitnami.conf /etc/monit/conf.d/bitnami.conf
RedHat, CentOS or AWS Linux
Follow these steps:
$ sudo yum install monit $ sudo ln -s installdir/config/monit/bitnami.conf /etc/monit.d/bitnami.conf
NOTE: If you do not find Monit in your repositories, add the EPEL repository in your repository list.
|NOTE: When running the commands shown on this page, replace the installdir placeholder with the full installation directory for your Bitnami stack.|