Now you need to start the service using the following command # You must set this variable to for monit to start Once you don’t have any syntax errors you need to enable this service by changing the file /etc/default/monit The configuration file is pretty self-explaining if you are unsure about an option, take a look at the monit documentation Īfter configuring your monit file you can check the configuration file syntax using the following command You can also include other configuration files via include directives: If failed port 22 protocol ssh then restart If 5 restarts within 5 cycles then timeoutĬheck process sshd with pidfile /var/run/sshd.pid If failed host 127.0.0.1 port 3306 then restart Start program = “/etc/init.d/mysql start” If 3 restarts within 5 cycles then timeoutĬheck process mysql with pidfile /var/run/mysqld/mysqld.pid ![]() If loadavg(5min) greater than 10 for 8 cycles then stop If totalmem > 200.0 MB for 5 cycles then restart If cpu is greater than 60% for 2 cycles then alert # Admin will notify by mail if below of the condition satisfied. Stop program = “/etc/init.d/apache2 stop” Start program = “/etc/init.d/apache2 start” #Below is actions taken by monit when service got stuck. tough apache2 is running.Ĭheck process apache2 with pidfile /var/run/apache2.pid # If process name or pidfile path is wrong then monit will # It will check process apache2 with given pid file. Use address localhost # only accept connection from localhostĪllow localhost # allow localhost to connect to the server andĪllow admin:monit # require user ‘admin’ with password ‘monit’ # configuration, actual services parameters or manage the services using the # Monit has an embedded webserver, which can be used to view the # or sender using the MAIL-FORMAT statement. # You can override the alert message format or its parts such as subject Subject: monit alert - $EVENT $SERVICE # subject # Monit by default uses the following alert mail format: Set mailserver localhost # primary mailserver # possible to override it with the PORT option. # Set list of mailservers for alert delivery. # path to the file for monit native logging. # omited, monit will use ‘user’ facility by default. ![]() # Set syslog logging with the ‘daemon’ facility. # Start monit in background (run as daemon) and check the services at 2-minute ![]() Sample Configuration file as follows and uncomment all the following options This will complete the installation with all the required software.ĭefault configuration file located at /etc/monit/monitrc you need to edit this file to configure your options * An http interface with optional SSL support to make monit accessible from a webbrowser HTTP, FTP, SMTP, POP, IMAP, NNTP, SSH, DWP,LDAPv2 and LDAPv3 * Flexible and customizable email alert messages * Alert notification for program timeout, restart, checksum, stop resource and timestamp error * MD5 checksum for programs started and stopped by monit * Alert, stop or restart a process based on its characteristics * Runtime and TCP/IP port checking (tcp and udp) * Configuration – comprehensive controlfile * Monitoring modes – active, passive or manual * Daemon mode – poll programs at a specified interval Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations. Monit is a utility for managing and monitoring, processes, files, directories and devices on a UNIX system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |