Changes

From Amahi Wiki
Jump to: navigation, search
189 bytes removed ,  15:32, 8 December 2013
no edit summary
File location for Monit configuration file (monitrc):
* Ubuntu
{{code| cd /etc/monit}}
* Fedora 19
{{code| cd /etc}}
== Change Hostname ==
Edit monitrc and change ''localhost.localdomain'' to match your system:
{{Text|Text= check system localhost.localdomain}}<br />
== Email Notifications ==
You can do it in Monit directly by adding the following to monitrc:
{{Text|Text= set mailserver smtp.gmail.com port 587
username "MYUSER" password "MYPASSWORD"
using tlsv1}}
Enable email notifications by editing monitrc and adding 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:
* Ubuntu
{{Code| /etc/init.d/monit restart}}
* Fedora 19
{{Code| systemctl restart monit.service}}
== Change Message Format ==
Edit monitrc and add this text (modify as needed):
{{Text|Text= set mail-format <nowiki>{</nowiki>
from: monit@localhost
subject: [ $SERVICE ] $EVENT - $DATE
message: This is an $ACTION: $DESCRIPTION [$SERVICE], tested remotely from $HOST <nowiki>}</nowiki>}}
Restart Monit:
* Ubuntu
{{Code| /etc/init.d/monit restart}}
* Fedora 19
{{Code| systemctl restart monit.service}}
== Change Access Credentials ==
Edit monitrc and change as desired:
{{Text|Text= allow admin:admin}}
Restart Monit:
* Ubuntu
{{Code| /etc/init.d/monit restart}}
* Fedora 19
{{Code| systemctl restart monit.service}}
== Enable Secure access (Fedora 19) ==
Edit monitrc and add below <u>set httpd port 2812 and</u> (line 116):
{{text| SSL ENABLE PEMFILE /var/certs/monit.pem}}
== Create New Certificate ==
A default certificate is installed by the Amahi application (Ubuntu). To create a new certificate, do the following steps as root user (<b>Ubuntu NOTE:</b> prefix commands with <code>sudo</code> except the second openssl requires the actual '''''root''''' user environment <code>sudo su -</code>):
{{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}}
Restart Monit:
* Ubuntu
{{Code| sudo /etc/init.d/monit restart}}
* Fedora 19
{{Code| systemctl restart monit.service}}
== Configuration Examples ==
12,424

edits