![]() If you have your MySQL error logging enabled you will get a warning output about unauthenticated users which is monit checking the MariaDB service. That’s it, test the monitoring by intentionally stopping MariaDB and waiting for 2 minutes’ish systemctl stop mariadb Fix MySQL logging ln -s /etc/monit/conf-available/mysql /etc/monit/conf-enabled/ Make a soft link to the mysql config from the config available directory to the config enabled directory. ![]() If failed unixsocket /var/run/mysqld/mysqld.sock protocol mysql for 3 times within 4 cycles then restartĬheck file mysql_bin with path /usr/sbin/mysqldĬheck file mysql_rc with path /etc/init.d/mariadb If failed host localhost port 3306 protocol mysql with timeout 15 seconds for 3 times within 4 cycles then restart Stop program = "/etc/init.d/mariadb stop" Start program = "/etc/init.d/mariadb start" To the following which basically changes the content from mysql to mariadb check process mysqld with pidfile /var/run/mysqld/mysqld.pid That’s monit up and running, now lets add a monitoring process on mariadb database which will restart it if it is terminated due to lack of resources.Ĭhange the content of the mysql config file: /etc/monit/conf-available/mysql Localhost # fallback relay Check monit config syntaxĪny changes you do to the monit config file can be syntax checked with: monit -t Add MariaDB service to be watched by monit Set mailserver 127.0.0.1, # primary mailserver I am using postfix for sending server emails, search for ‘ set alert‘ and ‘ set mailserver‘ and uncomment and set your email config, there are more email options that can be set in the config file such as sending email for a certain monitoring service. You can now also view the monit stats via the command line with: monit status Email AlertsĮmail alerts for Monit can also be configured in the monitrc file. Now you can view via a browser, use your server IP and 2812 port number – use http protocol or configure https for use. Use address 0.0.0.0 # only accept connection from localhost (drop if you use M/Monit)Īllow 0.0.0.0/0 # allow localhost to connect to the server andĪllow admin:password # require user 'admin' with password 'password' In the config file, look for httpd port and uncomment the lines and set your password. Loaded: loaded (/etc/init.d/monit generated)Īctive: active (running) since Sat 16:23:58 AEST 42s ago Get the monit version monit -version View and tail the monit log tail -f /var/log/monit.log Configure Monitīack up the original monit config file cp /etc/monit/monitrc /etc/monit/monitrc.bak Web Access rvice - LSB: service and resource monitoring daemon.Status will tell if it’s running systemctl status monit SSH as root into your VM instance and install Monit apt update apt install monit Start/stop/restart and see the status of monit systemctl status monit systemctl start monit systemctl stop monit systemctl restart monit ![]() Get up and running with Monit on Ubuntu 22.04 Install Monit
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |