6/18/2023 0 Comments Monit program service checkIf failed port 443 type tcpssl protocol http Start program = "/etc/init.d/nginx start" This last check process entry monitors Nginx and contains two service tests:Ĭheck process nginx with pidfile /var/run/nginx.pid For example, protocol http timeout 5 seconds can be written as protocol http and with timeout 5 seconds.) Monit ignores these keywords in a configuration file, increasing its resemblance to English and improving its readability. (To quickly switch to the topic of readability, and, with, has, using, and program are examples of noise keywords. If Monit does not receive a response after 5 seconds, then it generates an alert. If CouchDB is running, then Monit evaluates the service test at the end, which attempts to request from CouchDB the URL /some_db over HTTP on port 5984. If Monit cannot find the PID file /usr/local/var/run/couchdb/couchdb.pid, then it assumes that CouchDB is not running and executes /etc/init.d/couchdb start. Stop program = "/etc/init.d/couchdb stop" Start program = "/etc/init.d/couchdb start" If a process is not running, then Monit executes the command specified by start program.įor example, the following check process entry monitors uWSGI:Ĭheck process couchdb with pidfile /usr/local/var/run/couchdb/couchdb.pid (For more details about PID files, consult this answer on Stack Overflow and this answer on the Unix & Linux Stack Exchange.) The expected location of the PID file is specified in the service entry by with pidfile. Monit always tests whether such a process is running by checking for the existence of its PID file, which simply contains the process identifier. ProcessesĪ service entry starting with check process contains service tests to ensure that a daemon process is running as expected. Now let’s look at some service entry types, and some of the service tests they can define. There are many, but below we will only look at alert and restart. action specifies what Monit should do if the error condition is satisfied.Complicated ones can be split across multiple lines. body specifies an error condition for the resource.Each service test has the form if then, where: identifier is a unique identifier for this service entry, used in the web interface and included in any alert messages delivered via email.Īn entry restricts the service tests defined inside of it to those that are meaningful for its resource. ![]()
0 Comments
Leave a Reply. |