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