![]() Monit itself can be monitored by an external tool, to ensure that monitoring is working well.I've asked this question around a week a go at StackOverflow but no answer just yet, probably is no possible but don't know where to look for that answer, I hope someone can help over here. 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. /etc/monit/conf.d/.: Like Apache, you can configure Monit in the main config file or split your configuration into different sub-files so that each service has a dedicated configuration file in this directory. ![]() /etc/logrotate.d/monit: A log file rotation configuration./etc/default/monit: The default command line arguments./etc/monit/monitrc: The main config file.Launched as service in /etc/init.d/monit, but should be managed by systemd if your system uses it. /usr/bin/monit: The executable of the Monit command line and the monitoring daemon. ![]() This is required by Monit to send email notifications. There are some suggested dependencies concerning a mail transport agent. Processing triggers for man-db (2.9.4-2). 28311 files and directories currently installed.) Selecting previously unselected package monit. The following NEW packages will be installed:Ġ upgraded, 1 newly installed, 0 to remove and 0 not upgraded.Īfter this operation, 1023 kB of additional disk space will be used. Default-mta | postfix | mail-transport-agent sysvinit-core
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |