WRT Router Series Monit: Difference between revisions

mNo edit summary
Line 8: Line 8:
opkg install monit
opkg install monit


=== Configuration Files ===
===Configuration File(s) for Monit Service===
/etc/monitrc
/etc/monitrc


If configuring in a fashion similar to operating systems such as CentOS, then;
If configuring in a fashion similar to operating systems such as CentOS, then;


* Create this Directory: /etc/monit.d
*Create this Directory: /etc/monit.d
* Add this line or un-comment this line from /etc/monitrc: include /etc/monit.d/*
*Add this line or un-comment this line from /etc/monitrc: include /etc/monit.d/*
* Add additional configuration files to the /etc/monit.d Directory
*Add additional configuration files to the /etc/monit.d Directory


=== Configuration ===
===Configuration===
The default configuration for Monit from OpenWRT is configured in a very secure, with limited capability to view information (IE, it's only available from the command line, see the below configuration section from /etc/monitrc);<syntaxhighlight lang="text">
The default configuration for Monit from OpenWRT is configured in a very secure, with limited capability to view information (IE, it's only available from the command line, see the below configuration section from /etc/monitrc);<syntaxhighlight lang="text">
set httpd port 2812 and
set httpd port 2812 and
Line 30: Line 30:
</syntaxhighlight>
</syntaxhighlight>


=== Notifications & Alerts ===
=== Configuration of Individual Service(s) Monitoring ===
If configured in the manner described in the Configuration File(s) for Monit Service section, each of the following example can be placed in a separate text file in the /etc/monit.d directory.
 
Apache Example;<syntaxhighlight lang="text">
check process httpd with pidfile /tmp/run/apache2/httpd.pid
start program "/etc/init.d/apache2 start"
stop program "/etc/init.d/apache2 stop"
restart program "/etc/init.d/apache2 restart"
if 5 restarts within 5 cycles then timeout
</syntaxhighlight>BIND / NAMED Example;
 
DHCPC Example
 
MySQL Example
 
===Notifications & Alerts===
The Monit service can also send email notifications and alerts.  This can get annoying over time, but it is useful if troubleshooting or monitoring a process.  The annoyance can also be "reigned in" to a certain degree.
The Monit service can also send email notifications and alerts.  This can get annoying over time, but it is useful if troubleshooting or monitoring a process.  The annoyance can also be "reigned in" to a certain degree.