Changes

From Amahi Wiki
Jump to: navigation, search
2,484 bytes added ,  01:35, 27 August 2019
* Ubuntu
sudo /etc/init.d/monit restart
* Fedora 19 (root user)
systemctl restart monit.service
* Ubuntu
sudo /etc/init.d/monit restart
* Fedora 19 (root user)
systemctl restart monit.service
* Ubuntu
sudo /etc/init.d/monit restart
* Fedora 19 (root user)
systemctl restart monit.service
== Enable Secure access (Fedora 19) ==
Edit monitrc and add below <u>set httpd port 2812 and</u> (line 116):
SSL ENABLE
* Ubuntu
sudo /etc/init.d/monit restart
* Fedora 19 (root user)
systemctl restart monit.service
== Configuration Examples ==
===Amahi 8 or Greater===
'''httpd:'''
<pre>check process apache with pidfile "/var/run/httpd/httpd.pid"
start program = "/usr/bin/systemctl start httpd.service"
stop program = "/usr/bin/systemctl stop httpd.service"</pre>
 
'''mariadb:'''
<pre>check process mysql with pidfile "/var/run/mariadb/mariadb.pid"
start program = "/usr/bin/systemctl start mariadb.service"
stop program = "/usr/bin/systemctl stop mariadb.service"</pre>
 
'''dnsmasq:'''
<pre>check process dnsmasq with pidfile /var/run/dnsmasq.pid
start program = "/usr/bin/systemctl start dnsmasq.service"
stop program = "/usr/bin/systemctl stop dnsmasq.service"</pre>
 
'''sshd:'''
<pre>check process sshd with pidfile /var/run/sshd.pid
start program "/etc/init.d/sshd start"
stop program "/etc/init.d/sshd stop"
if failed port 22 protocol ssh then restart</pre>
 
'''postfix:'''
<pre> check process postfix with pidfile /var/spool/postfix/pid/master.pid
group mail
start program = "/etc/init.d/postfix start"
stop program = "/etc/init.d/postfix stop"
if failed port 25 protocol smtp then restart</pre>
 
'''crond:'''
<pre>check process crond with pidfile /var/run/crond.pid
group system
start program = "/usr/bin/systemctl start crond.service"
stop program = "/usr/bin/systemctl stop crond.service"
if 5 restarts within 5 cycles then timeout</pre>
 
'''hda-ctl:'''
<pre>check process hda-ctl with pidfile /var/run/hda-ctl.pid
start program = "/usr/bin/systemctl start hda-ctl.service"
stop program = "/usr/bin/systemctl stop hda-ctl.service"</pre>
 
'''syslogd:'''
<pre>check process syslog with pidfile /var/run/syslogd.pid
start program = "/usr/bin/systemctl start syslog.service"
stop program = "/usr/bin/systemctl stop syslog.service"
if 5 restarts within 5 cycles then timeout</pre>
 
'''storagespace:'''
<pre># add each drive you want to monitor below
check filesystem Boot with path /dev/sda1
if space usage > 90% then alert
check filesystem Root with path /dev/sda3
if space usage > 90% then alert
check filesystem Shares with path /dev/sda4</pre>
 
'''qbittorrent'''
<pre>check process qBittorrent matching "qbittorrent-nox"
start program = "/usr/bin/systemctl start qbittorrent-nox@bigfoot.service"
stop program = "/usr/bin/systemctl stop qbittorrent-nox@bigfoot.service"
if failed host 127.0.0.1 port 8090 type TCP for 2 cycles then restart
if 2 restarts within 3 cycles then unmonitor</pre>
 
===Reference===
[http://mmonit.com/wiki/Monit/ConfigurationExamples Monit Configuration Examples]: Covers many common processes that users may want to monitor. Some minor changes may be needed for Fedora or Ubuntu.
[[Category:Apps]]
12,424

edits