ecd096d4712737eef56e1e7633749e275362d3c8
[carnet-upgrade.git] / files / etc / monit / monitrc.restore
1 ###############################################################################
2 ## Monit control file
3 ###############################################################################
4 ##
5 ## Comments begin with a '#' and extend through the end of the line. Keywords
6 ## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
7 ##
8 ## Bellow is the example of some frequently used statements. For information
9 ## about the control file, a complete list of statements and options please 
10 ## have a look in the monit manual.
11 ##
12 ##
13 ###############################################################################
14 ## Global section
15 ###############################################################################
16 ##
17 ## Start monit in background (run as daemon) and check the services at 2-minute
18 ## intervals.
19 #
20 # set daemon  120
21 #
22 #
23 ## Set syslog logging with the 'daemon' facility. If the FACILITY option is
24 ## omited, monit will use 'user' facility by default. You can specify the
25 ## path to the file for monit native logging.
26 #
27 # set logfile syslog facility log_daemon 
28 #
29 #
30 ## Set list of mailservers for alert delivery. Multiple servers may be 
31 ## specified using comma separator. By default monit uses port 25 - it is 
32 ## possible to override it with the PORT option.
33 #
34 # set mailserver mail.bar.baz,               # primary mailserver
35 #                backup.bar.baz port 10025,  # backup mailserver on port 10025
36 #                localhost                   # fallback relay
37 #
38 #
39 ## By default monit will drop the event alert, in the case that there is no
40 ## mailserver available. In the case that you want to keep the events for
41 ## later delivery retry, you can use the EVENTQUEUE statement. The base
42 ## directory where undelivered events will be stored is specified by the
43 ## BASEDIR option. You can limit the maximal queue size using the SLOTS
44 ## option (if omited then the queue is limited just by the backend filesystem).
45 #
46 # set eventqueue
47 #     basedir /var/monit  # set the base directory where events will be stored
48 #     slots 100           # optionaly limit the queue size
49 #
50 #
51 ## Monit by default uses the following alert mail format:
52 ##
53 ## --8<--
54 ## From: monit@$HOST                         # sender
55 ## Subject: monit alert --  $EVENT $SERVICE  # subject
56 ##
57 ## $EVENT Service $SERVICE                   #
58 ##                                           #
59 ##      Date:        $DATE                   #
60 ##      Action:      $ACTION                 #
61 ##      Host:        $HOST                   # body
62 ##      Description: $DESCRIPTION            #
63 ##                                           #
64 ## Your faithful employee,                   #
65 ## monit                                     #
66 ## --8<--
67 ##
68 ## You can override the alert message format or its parts such as subject
69 ## or sender using the MAIL-FORMAT statement. Macros such as $DATE, etc.
70 ## are expanded on runtime. For example to override the sender:
71 #
72 # set mail-format { from: monit@foo.bar }
73 #
74 #
75 ## You can set the alert recipients here, which will receive the alert for
76 ## each service. The event alerts may be restricted using the list.
77 #
78 # set alert sysadm@foo.bar                       # receive all alerts
79 # set alert manager@foo.bar only on { timeout }  # receive just service-
80 #                                                # timeout alert
81 #
82 #
83 ## Monit has an embedded webserver, which can be used to view the 
84 ## configuration, actual services parameters or manage the services using the 
85 ## web interface.
86 #
87 # set httpd port 2812 and
88 #     use address localhost  # only accept connection from localhost
89 #     allow localhost        # allow localhost to connect to the server and
90 #     allow admin:monit      # require user 'admin' with password 'monit'
91 #
92 #
93 ###############################################################################
94 ## Services
95 ###############################################################################
96 ##
97 ## Check the general system resources such as load average, cpu and memory
98 ## usage. Each rule specifies the tested resource, the limit and the action
99 ## which will be performed in the case that the test failed.
100 #
101 #  check system myhost.mydomain.tld
102 #    if loadavg (1min) > 4 then alert
103 #    if loadavg (5min) > 2 then alert
104 #    if memory usage > 75% then alert
105 #    if cpu usage (user) > 70% then alert
106 #    if cpu usage (system) > 30% then alert
107 #    if cpu usage (wait) > 20% then alert
108 #
109 #    
110 ## Check a file for existence, checksum, permissions, uid and gid. In addition
111 ## to the recipients in the global section, customized alert will be send to 
112 ## the additional recipient. The service may be grouped using the GROUP option.
113 #    
114 #  check file apache_bin with path /usr/local/apache/bin/httpd
115 #    if failed checksum and 
116 #       expect the sum 8f7f419955cefa0b33a2ba316cba3659 then unmonitor
117 #    if failed permission 755 then unmonitor
118 #    if failed uid root then unmonitor
119 #    if failed gid root then unmonitor
120 #    alert security@foo.bar on {
121 #           checksum, permission, uid, gid, unmonitor
122 #        } with the mail-format { subject: Alarm! }
123 #    group server
124 #
125 #    
126 ## Check that a process is running, responding on the HTTP and HTTPS request, 
127 ## check its resource usage such as cpu and memory, number of childrens. 
128 ## In the case that the process is not running, monit will restart it by 
129 ## default. In the case that the service was restarted very often and the 
130 ## problem remains, it is possible to disable the monitoring using the
131 ## TIMEOUT statement. The service depends on another service (apache_bin) which
132 ## is defined in the monit control file as well.
133 #    
134 #  check process apache with pidfile /usr/local/apache/logs/httpd.pid
135 #    start program = "/etc/init.d/httpd start"
136 #    stop program  = "/etc/init.d/httpd stop"
137 #    if cpu > 60% for 2 cycles then alert
138 #    if cpu > 80% for 5 cycles then restart
139 #    if totalmem > 200.0 MB for 5 cycles then restart
140 #    if children > 250 then restart
141 #    if loadavg(5min) greater than 10 for 8 cycles then stop
142 #    if failed host www.tildeslash.com port 80 protocol http
143 #       and request "/monit/doc/next.php"
144 #       then restart
145 #    if failed port 443 type tcpssl protocol http
146 #       with timeout 15 seconds
147 #       then restart
148 #    if 3 restarts within 5 cycles then timeout
149 #    depends on apache_bin
150 #    group server
151 #    
152 #    
153 ## Check the device permissions, uid, gid, space and inode usage. Other
154 ## services such as databases may depend on this resource and automatical
155 ## graceful stop may be cascaded to them before the filesystem will become
156 ## full and the data will be lost.
157 #
158 #  check device datafs with path /dev/sdb1
159 #    start program  = "/bin/mount /data"
160 #    stop program  = "/bin/umount /data"
161 #    if failed permission 660 then unmonitor
162 #    if failed uid root then unmonitor
163 #    if failed gid disk then unmonitor
164 #    if space usage > 80% for 5 times within 15 cycles then alert
165 #    if space usage > 99% then stop
166 #    if inode usage > 30000 then alert
167 #    if inode usage > 99% then stop
168 #    group server
169 #
170 #
171 ## Check a file's timestamp: when it becomes older then 15 minutes, the 
172 ## file is not updated and something is wrong. In the case that the size 
173 ## of the file exceeded given limit, perform the script.
174 #
175 #  check file database with path /data/mydatabase.db
176 #    if failed permission 700 then alert
177 #    if failed uid data then alert
178 #    if failed gid data then alert
179 #    if timestamp > 15 minutes then alert
180 #    if size > 100 MB then exec "/my/cleanup/script"
181 #
182 #
183 ## Check the directory permission, uid and gid.  An event is triggered
184 ## if the directory does not belong to the user with the  uid 0 and 
185 ## the gid 0.  In the addition the permissions have to match the octal 
186 ## description of 755 (see chmod(1)).
187 #
188 #  check directory bin with path /bin
189 #    if failed permission 755 then unmonitor
190 #    if failed uid 0 then unmonitor
191 #    if failed gid 0 then unmonitor
192 #
193 #
194 ## Check the remote host network services availability and the response
195 ## content.  One of three pings, a successfull connection to a port and 
196 ## application level network check is performed.
197 #
198 #  check host myserver with address 192.168.1.1
199 #    if failed icmp type echo count 3 with timeout 3 seconds then alert
200 #    if failed port 3306 protocol mysql with timeout 15 seconds then alert
201 #    if failed url
202 #       http://user:password@www.foo.bar:8080/?querystring
203 #       and content == 'action="j_security_check"'
204 #       then alert
205 #
206 #
207 ###############################################################################
208 ## Includes
209 ###############################################################################
210 ##
211 ## It is possible to include the configuration or its parts from other files or
212 ## directories.
213 #
214 #  include /etc/monit.d/*
215 #
216 #