Difference between revisions of "Monit"

From Amahi Wiki
Jump to: navigation, search
Line 6: Line 6:
  
 
== Email Notifications ==
 
== Email Notifications ==
This will only work if you have set up your HDA to send emails.  The [[Gmail_As_Relay_On_Ubuntu|Gmail as Relay]] tutorial is one option.
+
This will only work if you have set up your HDA to send emails.  The [[Gmail_As_Relay_On_Ubuntu|Gmail as Relay]] tutorial is one option or you can do it in Monit directly.
  
Edit /etc/monit/monitrc and uncomment (remove #) the following lines (Change as needed to match your system):
+
Edit /etc/monit/monitrc and update as follows:
 +
{{Text|Text=set mailserver smtp.gmail.com port 587
 +
    username "MYUSER" password "MYPASSWORD"
 +
    using tlsv1}}
 +
'''NOTE:'''  Replace "MYUSER" and "MYPASSWORD" with your Gmail user name and password.
 +
 
 +
Enable email notifications by editing /etc/monit/monitrc and uncomment (remove #) the following lines (Change as needed to match your system):
 
{{Text|Text=<nowiki>#</nowiki>set mailserver localhost
 
{{Text|Text=<nowiki>#</nowiki>set mailserver localhost
 
<nowiki>#</nowiki>set mail-format { from: monit@localhost }
 
<nowiki>#</nowiki>set mail-format { from: monit@localhost }
Line 22: Line 28:
  
 
== Update Certificate ==
 
== Update Certificate ==
To change the certificate to match your area, do the following steps as root user (For Ubuntu, prefix the command lines with <code>sudo</code>):
+
A default certificate is installed by the Amahi application.  To change the certificate, do the following steps as root user (For Ubuntu, prefix the command lines with <code>sudo</code>):
 
{{Code|cd /var/certs
 
{{Code|cd /var/certs
 
openssl req -new -x509 -days 365 -nodes -config ./monit.cnf -out /var/certs/monit.pem -keyout /var/certs/monit.pem
 
openssl req -new -x509 -days 365 -nodes -config ./monit.cnf -out /var/certs/monit.pem -keyout /var/certs/monit.pem
Line 28: Line 34:
 
openssl x509 -subject -dates -fingerprint -noout -in /var/certs/monit.pem
 
openssl x509 -subject -dates -fingerprint -noout -in /var/certs/monit.pem
 
chmod 700 /var/certs/monit.pem}}
 
chmod 700 /var/certs/monit.pem}}
 +
 +
'''NOTE:'''  For Ubuntu, the second openssl (openssl gendh) step requires the actual '''''root''''' user  environment (<code>sudo su -</code>).
 +
 
Restart Monit:
 
Restart Monit:
 
{{Code|/etc/init.d/monit restart}}
 
{{Code|/etc/init.d/monit restart}}
 
'''NOTE:'''  For Ubuntu, the second openssl (openssl gendh) step requires the actual '''''root''''' user  environment (<code>sudo su -</code>).
 
  
  
 
[[Category:Apps]]
 
[[Category:Apps]]

Revision as of 17:34, 21 July 2012

Monit (Amahi's watchdog) is a utility for managing and monitoring processes, programs, files, directories and filesystems on a Unix system. It is integrated in Amahi and managed using the Servers section of the Settings tab.

Monit has an integrated web interface which can exposed using the Monit Web Interface one-click app. This app (currently BETA status) provides additional detail about the processes currently running on your HDA.

We will add additional customizations to this page over time.

Email Notifications

This will only work if you have set up your HDA to send emails. The Gmail as Relay tutorial is one option or you can do it in Monit directly.

Edit /etc/monit/monitrc and update as follows:

Text
​set mailserver smtp.gmail.com port 587 username "MYUSER" password "MYPASSWORD" using tlsv1​

NOTE: Replace "MYUSER" and "MYPASSWORD" with your Gmail user name and password.

Enable email notifications by editing /etc/monit/monitrc and uncomment (remove #) the following lines (Change as needed to match your system):

Text
​#set mailserver localhost #set mail-format { from: monit@localhost } #set alert root@localhost​

Restart Monit:

bash code
​/etc/init.d/monit restart​


Change Password

Edit Edit /etc/monit/monitrc and change as desired:

Text
​allow admin:admin​

Restart Monit:

bash code
​/etc/init.d/monit restart​


Update Certificate

A default certificate is installed by the Amahi application. To change the certificate, do the following steps as root user (For Ubuntu, prefix the command lines with sudo):

bash code
​cd /var/certs openssl req -new -x509 -days 365 -nodes -config ./monit.cnf -out /var/certs/monit.pem -keyout /var/certs/monit.pem openssl gendh 512 >> /var/certs/monit.pem openssl x509 -subject -dates -fingerprint -noout -in /var/certs/monit.pem chmod 700 /var/certs/monit.pem​


NOTE: For Ubuntu, the second openssl (openssl gendh) step requires the actual root user environment (sudo su -).

Restart Monit:

bash code
​/etc/init.d/monit restart​