Procmatch - Test process matching pattern Validate - Check all services and start if not running Summary - Print short status information for service(s) Status - Print full status information for service(s) Unmonitor - Only disable monitoring of the named service Unmonitor all - Disable monitoring of all services Monitor - Only enable monitoring of the named service Monitor all - Enable monitoring of all services Restart all - Stop and start all services Paste the script below in the file /usr/local/sbin/check-backup.sh (or anywhere you prefer) and chmod u+x monit -h Start to create a script that returns "1" if a backup exists for the current day, or "0" if none exists. Borg can report itself any failure during backup operations, but it is still better to have a second eye on backups. If the daily backup does not exist, the backup monitor will turn red and an email will warn the administrator. We want to check that every day a Borg backup occurred well. Step 6 - Add a monitor to check daily backups This monitor checks every 10 minutes (5 cycles of 120s) if the connection to is possible with https protocol, if the certificate is valid, and if the string Welcome on my running website appears in the response. # Change hostname according to your needsĬontent = "Welcome on my running website"ĭon't forget to reload Monit ( monit reload) after the configuration was changed. As the configuration was changed, you need to reload Monit daemon (as root):Ĭheck host "My website" with address If you want to access the GUI from outside the local machine, remove or adapt the lines use address localhost and allow localhost.Ĭheck the other options available and save the file. You should change the default username/password of the web GUI in the line allow. Use address localhost # only accept connection from localhost (drop if you use M/Monit)Īllow localhost # allow localhost to connect to the server andĪllow admin:monit # require user 'admin' with password 'monit' # To receive all email alerts (customizable per monitor) # Remove front # comment and set your sender email # E.g.: If a service is monitored every 3 cycles, it means that the daemon checks the service status every 6 minutes. The more frequent the checks, the more CPU they consume but the faster they report problems. Later monitoring frequency is defined in number of cycles. If everything is going well, Monit daemon should already be running in the background. and /etc/monit/conf-enabled/.: Like Apache, it's possible to have a configuration in the first directory, and symlinks in the second directory to enable or disable some monitor settings. These files are concatenated to the main file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |