Then restart Monit sudo service monit restart You should see the OK below, if you don't it's ok, it probably means you are on Debian Jessie or Ubuntu 15.x and later Control file syntax OK Test monit syntax is correct for the configuration file sudo monit -t Modify permissions of the new monit configuration to avoid this error The control file '/etc/monit/monitrc' must have permissions no more than -rwx- (0700) right now permissions are -rw-r-r- (0644).įix the permissions sudo chmod 0700 /etc/monit/monitrc # allow # allow dynamicdns address to connectĪllow htpc: "guides" # require user htpc with password guides Set httpd port 2812 address 0.0.0.0 # allow port 2812 connections on all network adaptersĪllow 0.0.0.0/0.0.0.0 # allow all IPs, can use local subnet too # set alert #email address which will receive monit alerts #http settings # from: subject: monit alert - $EVENT $SERVICE Slots 100 # optionally limit the queue size set daemon 60 #check services every 60 secondsīasedir /var/lib/monit/events # set the base directory where events will be stored ![]() If you don't use Dynamic DNS then comment that line out with a # symbol. You should change the allow htpc: guides to the username and password you want to use to access Monit. This will effectively whitelist only your home IP to access Monit. If you do use free Dynamic DNS then comment out the allow 0.0.0.0 line by preceding with # and uncomment (remove #) for the allow line. The http settings are for setting the port and address for Monit to listen on This is disabled by default so remove the # to enable it. ![]() Set alert to the email address you wish to receive the monit emails on, when using Google set it to allow insecure apps (other solutions here). Set the username “htpc” and password “guides” to your gmail credentials You will need to uncomment the lines under Mail settings by deleting the # to activate them This Monit configuration assumes you are using a gmail account for sending and receiving notifications Paste the block below while making appropriate changes Open the Monit configuration sudo nano /etc/monit/monitrc This command changes the permissions of the monit ssl certificate sudo chmod 0700 /var/certs/monit.pem Install Monit from RepositoryĮasy as always straight from the repository sudo apt-get install monit -yīackup the old Monit configuration sudo mv /etc/monit/monitrc /etc/monit/monitrc.bak etc/monit/monitrc:124: Error: SSL server PEM file permissions check failed 'allow' Modify the permissions to prevent this error monit: The SSL server PEM file '/var/certs/monit.pem' must have permissions no more than -rwx- (0700) right now permissions are -rw-r-r- (0644). sudo openssl req -new -x509 -days 365 -nodes -out /var/certs/monit.pem -keyout /var/certs/monit.pem If you want to increase the validation period increase 365 to something like 36500 (100 years). Generate a key, you can enter the information it prompts for if you want but it is not necessary, you can just leave it blank. Install OpenSSL sudo apt-get install openssl -yĬreate certs folder sudo mkdir -p /var/certs ![]() We need an SSL certificate for Monit in order to look at the Monit web interface securely. I have already prepared a thorough guide for most media server programs posted here. Tests if a URL is accessible and returns specific content.Tests if port or unix socket is open on the loopback address.Monitors the existence of the pid file, if it is no longer present the program is restarted.Here is what the Monit configurations essentially do for each service Install Secure Monit to Monitor Home Media Server Updated Janufixed mail settings and sudo omissions ![]() This is a monit installation using https and your own self-signed certificate. I also show you how to use your gmail account to send monit alerts from your home media server. This monit tutorial shows you how to install monit securely on Ubuntu and Debian systems. I have already shown how to monitor Plex Media Server and restart it automatically if the Plex process has stopped in this guide.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |