

Mariadb: check process mysql with pidfile "/var/run/mariadb/mariadb.pid" Stop program = "/usr/bin/systemctl stop rvice" Start program = "/usr/bin/systemctl start rvice" Httpd: check process apache with pidfile "/var/run/httpd/httpd.pid" Openssl x509 -subject -dates -fingerprint -noout -in /var/certs/monit.pemĬonfiguration Examples Amahi 8 or Greater Openssl req -new -x509 -days 365 -nodes -config. To create a new certificate, do the following steps as root user ( Ubuntu NOTE: prefix commands with sudo except the second openssl requires the actual root user environment sudo su -):

Message: This is an $ACTION: $DESCRIPTION, tested remotely from $HOST }Įdit monitrc and add below set httpd port 2812 and (line 116):Ĭreate a directory for the certs, then follow "Create New Certificate" guidance:Ī default certificate is installed by the Amahi application (Ubuntu). NOTE: Replace "MYUSER" and "MYPASSWORD" with your Gmail user name and password.Įnable email notifications by editing monitrc and adding the following lines (Change as needed to match your system):Įdit monitrc and add this text (modify as needed): You can do it in Monit directly by adding the following to monitrc: The Gmail as Relay tutorial is one option. This will only work if you have set up your HDA to send emails. To know more about it see the official documentation.Edit monitrc and change localhost.localdomain to match your system: In this way, we can monitor our system using the lightweight M/Monit tool on Ubuntu Linux. Save the file: Ctrl+X, Y, and hit the Enter Key.Įnable it: sudo ln -s /etc/monit/conf-available/sensors /etc/monit/conf-enabled/ Sudo nano/etc/monit/conf-available/sensorsĪdd: check program sensors with path /usr/bin/sensors For example, you want to detect all information about your system hardware using sensors. Now, if you want to add some service manually, then you have to create a file for the same. In the same way, we can enable other services. To make the changes effective Monit daemon needs to be reloaded. Syntax: sudo ln -s /etc/monit/conf-available/ service-file /etc/monit/conf-enabled/Įxample for Apache : sudo ln -s /etc/monit/conf-available/apache2 /etc/monit/conf-enabled/ We want to monitor Apache using its pre-configured file. In order for Monit to take over the settings for the desired service, a soft link to the service file must be created and activated in the /etc/monit/conf-enabled/. Such as: acpid, at, mdadm, mysql, openntpd, pdns-recursor, rsyslog, snmpd,Īpache2, cron, memcached, nginx, openssh-server, postfix and smartmontools. In the /etc/monit/conf-available/ there are several ready-made files for various common server services, the defaults of which can usually be adopted. You can either create a service file for a tool to monitor or can use the pre-configured ones available in the M/Monit folder.

And point it to Enter username and password. Open browser on the local or remote system that can access the Ip-address of the server/pc where the Monit Monitor system has been installed. To access the Monit web interface outside your local host, allow its port or service in the firewall to access the public network. To know everything is working fine run- sudo monit status Allow M/Monit port in the firewall Restart it once sudo systemctl restart monit sudo /lib/systemd/systemd-sysv-install enable monit # Control file syntax OK Enable Monit service on Linuxīy default it would not be enabled, thus to do that, run the command to enable the service to get started automatically with the system boot. # If there are no errors, you will receive the following feedback: To check configuration files is without any errors use the following command: sudo monit -t Save the file by pressing Ctrl+X and then type – Y and hit the Enter key.
Monit file password#
Use address 0.0.0.0 # only accept connection from localhost (drop if you use M/M>Īllow 0.0.0.0/0 # allow localhost to connect to the server andĪllow admin: monit # require user 'admin' with password 'monit' You can also change the default password for the admin that is monit. Also, replace the allow and use address value from localhost to 0.0.0.0 if you want to access the Monit web interface remotely as shown in the screenshot. There remove the # tag for the following lines. It is better to create a new one – nano /etc/monit/conf.d/ for the desired settings.īy default, the port 2812 to communicate Monit will be disabled and has to be enabled by editing its configuration file. We recommend that you do not make your own settings directly in this file.

There are numerous sample settings, some of which are commented out, which are self-explanatory, or whose comments contain help texts. The Monit program can be configured using the /etc/monit/monitrc file. This tool package is there on Ubuntu’s repo and it doesn’t need any third-party repository help. Open the command terminal and simply type the below-given command.
